Re: UTF-8/Unicode support
Leon Bottou <[email protected]> Mon, 20 Feb 2006 11:12:16 -0500
| Newsgroups | gmane.lisp.lush.devel |
|---|---|
| Message-ID | <[email protected]> |
On Saturday 18 February 2006 02:30 pm, Raymond Martin wrote: > So even entering "ユーザーマニュアル" straight at the toplevel results in an error > regardless of the consoles ability to display the charmap. > ? "ユーザーマニュアル" > *** read : illegal character : 0x83 That was leftover assumptions about latin1 encoding. It works now (CVS). ? (setq z "ユーザーマニュアル") +++ Warning: use <defvar> to declare global variable <z>. = "ユーザーマニュアル" ? (explode-chars z) ;;; this returns the sequence of wchar_t = (12518 12540 12470 12540 12510 12491 12517 12450 12523) ? (explode-bytes z) = (227 131 166 227 131 188 227 130 182 227 131 188 227 131 158 227 131 139 227 131 165 227 130 162 227 131 171) ? (left z 1) ;;; still byte based = "\xe3" ? (left z 2) ;;; same = "\xe3\x83" ? (left z 3) ;;; that was a three byte combination = "ユ" ? (regex-subst "マ" "ザ" z) ;;; this works! = "ユーザーザニュアル" ? (regex-subst "(ザ.マ)" "[%0]" z) ;;; but this fails because '.' matchs only a single byte = "ユーザーマニュアル" ? (regex-subst "(ザ.*マ)" "[%0]" z) ;;; here is the fix. = "ユー[ザーマ]ニュアル" ? ;;; also I am pretty sure that the range operator in regexp does not work ;;; since it uses a bitmap inside... > A side-effect of changing the locale settings (to UTF-8) for Lush, as it was compiled > in an ISO-8859-1 environment, is that helptool will no longer come up for me. It works for me! I am already using UTF8 as my default locale. - L. ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642