Re: code critique




On Wed, 30 May 2007 17:13:27 +0200, Daniel Leidisch <news@xxxxxxxxxxxx> said:
| In article <87r6oyigvo.fsf@xxxxxxxxxxxxxxxxxx> you wrote:
|| ...
|| * A portability caveat: ANSI Common Lisp does not require characters
|| to be encoded in ASCII or any other encoding, and so CODE-CHAR may
|| not do what you expect here.

| Do you have any suggestions as to how to implement this
| more portably? After a quick (apropos 'ascii) I recognized
| that all fbound symbols are in the SB-IMPL package (sbcl is my
| cl-implementation of choice), so I assume that there is no standard
| way to do it. The first thing that came to my mind was to add an
| ascii table lookup myself. Is there a better solution?

Not really. Either you or a library writer needs to provide the
mapping for URL-encoded characters. (Imagine that your program is
running in EBCDIC land; how can it have "native" knowledge that,
say, #x20 (rather than #x40) is the code for #\Space?)

---Vassil.


--
The truly good code is the obviously correct code.
.



Relevant Pages

  • Re: POS. Cash Register on AS400.- New and Updates
    ... Probably the easiest way would be to send them as ASCII. ... You need to change the printer file to not convert unprintable characters. ... "The INITPRT tag defines the ASCII control ... but still can not open cash drawer. ...
    (comp.sys.ibm.as400.misc)
  • Re: Unicode Support
    ... consider:)...but, you know, a file is still just a "stream of characters" ... "escape sequence" but accessing an ordinary ASCII character) are considered ... English, while all your identifiers are in "Romanji" Japanese or something ... NASM appears already to do so with strings and comments in ...
    (alt.lang.asm)
  • Re: System 360 EBCDIC vs. ASCII
    ... I suppose they could have created a 7-bit architecture if it ... There are a few vestiges of 7-bit characters in other computer systems due ... If you set your modem to 8 bits you ... connections, including hardwired ones: plotters, ASCII terminals, etc. ...
    (bit.listserv.ibm-main)
  • Re: A problem to read a SEG-file using Fortran90 code on PC
    ... IBM EBCDIC codes for characters convert to normal ascii codes, ... from IBM mainframe sources.. ... If you have floating point values stored in a bit representation you ...
    (comp.lang.fortran)
  • Re: remove/replace non-ascii characters from file
    ... I suppose you mean "non-graphic ASCII". ... Well, I don't know that much about the ASCII *definition*, but if I open the file in Window$ notepad, these characters appear as additional spaces. ... So, if you are right, that means that M$ notepad converts these NUL characters to spaces, which is a bad thing, if these are indeed different characters and useful for anything. ... any ASCII stream without changing the meaning of the stream. ...
    (Debian-User)