Comment 2 for bug 2066217

Revision history for this message
Christophe Rhodes (csr21-cantab) wrote :

You can control unicode normalization in the lisp reader using the READTABLE-NORMALIZATION field of your readtable. https://www.sbcl.org/manual/#Symbol-Name-Normalization.

Using READ or READ-FROM-STRING is for converting text into Lisp code -- just reading the string itself (as text, from a stream) will not perform any normalization, but parsing it to Lisp using READ or one of its relatives will use the current readtable's.

> I want to keep the utf-8 parentheses as normal characters in string, not LISP parenthese as list mark.

When you read from the string you use in your test, you do not get a list. You get a symbol containing parenthesis characters, whether normalized to ascii parentheses or preserved as utf-8.

If you want a string with utf-8 parentheses, you can just use it: (char "測試(中文)" 2) returns #\FULLWIDTH_LEFT_PARENTHESIS.