Re: character encoding problem
[email protected] (Don Cohen) Wed, 15 Jan 2020 20:53:50 +0000
| Newsgroups | gmane.lisp.clisp.general |
|---|---|
| Message-ID | <[email protected]> |
> > (code-char #xd83c) > > #\UD83C > > This is not a valid unicode character codepoint. > > https://www.fileformat.info/info/unicode/char/d83c/index.htm This raises many questions - I guess I've never really understood the whole subject of internationalization and character sets. If that's a reason for convert-FROM-bytes to fail, why is it not also a reason for convert-TO-bytes to fail (both using the uft-8 encoding)? Is #\UD83C a valid any-other-type-of-character code point? It does seem to be a valid lisp CHARACTER. Is there some other encoding that allows all valid lisp characters? > > (setf str (make-string 1 :initial-element *)) > > "\355\240\274" > > > > (EXT:CONVERT-STRING-TO-BYTES * charset:utf-8) > > #(237 160 188) > > > > (EXT:CONVERT-STRING-from-BYTES * charset:utf-8) > > > > *** - EXT:CONVERT-STRING-FROM-BYTES: Invalid byte sequence #xED #xA0 #xBC in > > CHARSET:UTF-8 conversion > > > > What's illegal about this byte sequence? > > It seems to be the right one for #\UD83C. > > utf-8 is able to encode all the codepoints between 0 and 1,112,063, but if you encode an invalid codepoint, you should not be surprised if a system cannot convert it into a unicode character! > > > -- > __Pascal J. Bourguignon__ > > > > _______________________________________________ clisp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/clisp-list