From: Bruno H. <br...@cl...> - 2004-03-17 21:48:35
|
Don Cohen wrote: > I don't know what you you consider the standard repertoire. > (What are the curly quotes?) > And why does char-code not work on them? Oh, char-code works fine on them. It's only when you attempt to feed this char-code into a byte stream that expects values between 0 and 255 that you will get a nice error. > (write-string "=E2=80=9C=E2=80=98Ha ha=E2=80=99 said the clown=E2=80=9D f= rom Manfred Mann") =E2=80=9C=E2=80=98Ha ha=E2=80=99 said the clown=E2=80=9D from Manfred Mann "=E2=80=9C=E2=80=98Ha ha=E2=80=99 said the clown=E2=80=9D from Manfred Mann" > (map 'list #'char-code *) (8220 8216 72 97 32 104 97 8217 32 115 97 105 100 32 116 104 101 32 99 108 = 111 119 110 8221 32 102 114 111 109 32 77 97 110 102 114 101 100 32 77 97 110 = 110) > They might if they allowed the result to be put into an arbitrary > position of an existing vector. SETF SUBSEQ will copy a vector into an existing one. > So these depend on encodings but code-char and char-code do not? Yes, CONVERT-STRING-TO/FROM-BYTES work with any character and any encoding. Whereas the assumption of the 1980ies, that each character is a byte, works only for half the encodings of the world and for less than 1/10th of the characters of the world. Bruno |