[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: string-as-unibyte
From: |
YAMAMOTO Mitsuharu |
Subject: |
Re: string-as-unibyte |
Date: |
Tue, 19 Jul 2005 08:52:02 +0900 |
User-agent: |
Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/22.0.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) |
>>>>> On Tue, 19 Jul 2005 07:41:33 +0900, YAMAMOTO Mitsuharu <address@hidden>
>>>>> said:
> I was trying to make a coding system that almost works as utf-8, but
> additionally does "HFS+ composition" (canonical composition with
> some exclusions) on decoding.
> (when str
> (erase-buffer)
> (insert (if enable-multibyte-characters
> (string-as-multibyte str) str)))
Maybe this part should have been string-to-multibyte.
BTW, I noticed that backslashes in the docstring of
string-as-multibyte are stripped off as follows:
If you're not sure, whether to use `string-as-multibyte' or
`string-to-multibyte', use `string-to-multibyte'. Beware:
(aref (string-as-multibyte "201") 0) -> 129 (aka ?201)
(aref (string-as-multibyte "300") 0) -> 192 (aka ?300)
(aref (string-as-multibyte "300201") 0) -> 192 (aka ?300)
(aref (string-as-multibyte "300201") 1) -> 129 (aka ?201)
but
(aref (string-as-multibyte "201300") 0) -> 2240
(aref (string-as-multibyte "201300") 1) -> <error>
YAMAMOTO Mitsuharu
address@hidden