Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not support multibyte unicode character like \xAA\xBB\xCC with external-format #9

Open
muyinliu opened this issue Aug 10, 2019 · 1 comment

Comments

@muyinliu
Copy link

#?"\xe9\x87\x8f\xe4\xbb\xb7"

=>

"�价"

correct result should be "量价"

My temp solution is:

(babel:octets-to-string 
 (make-array 6 
             :element-type '(unsigned-byte 8) 
             :initial-contents (mapcar #'char-code
                                       (coerce #?"\xe9\x87\x8f\xe4\xbb\xb7"
                                               'list)))
 :encoding :utf-8)

=>

"量价"
@dieggsy
Copy link

dieggsy commented Jan 15, 2025

This isn't the same as what you're asking, but here are a couple alternative ways to achieve that string:

CL-USER> #?"\N{CJK Unified Ideograph-91CF}\N{CJK Unified Ideograph-4EF7}"
"量价"

Or more simply

CL-USER> #?"\x{91CF}\x{4EF7}"
"量价"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants