[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: UTF8 encoding!
From: |
Pascal Bourguignon |
Subject: |
Re: UTF8 encoding! |
Date: |
Tue, 2 Oct 2001 16:42:45 +0200 (CEST) |
> Date: Tue, 2 Oct 2001 13:05:46 +0100
> From: Richard Frith-Macdonald <richard@brainstorm.co.uk>
>
> Perhaps it should go like this -
>
> Can the message be converted to ascii?
> If so, log ascii data
> Can the message be converted to the default cString encoding?
> If so, log 8-bit data in the default encoding
> otherwise, log UTF8
>
> Anyone know?
It all depends on the terminal or file used. The xterm I use is able
to display 8-bit iso-latin-1 characters. If I wrote program using
UTF8, I guess I'd use a UTF8 capable terminal, or log to a file I
would read with a UTF8 capable editor.
Therefore, I would say that the best thing to do would be to have a
default, or an environment variable specifying the wanted encoding for
NSLog, and if it's not present to use the above algorithm.
(I guess that the UTF8 encoding of a unicode string containing only
ASCII character is composed exactly of these ASCII characters, and
it's perhaps true also for iso-latin-1 characters. Therefore, loggin
always in UTF8 may be almost as good a solution as that algorithm).
--
__Pascal_Bourguignon__ (o_ Software patents are endangering
() ASCII ribbon against html email //\ the computer industry all around
/\ and Microsoft attachments. V_/ the world http://lpf.ai.mit.edu/
1962:DO20I=1.100 2001:my($f)=`fortune`; http://petition.eurolinux.org/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/IT d? s++:++(+++)>++ a C+++ UB+++L++++$S+X++++>$ P- L+++ E++ W++
N++ o-- K- w------ O- M++$ V PS+E++ Y++ PGP++ t+ 5? X+ R !tv b++(+)
DI+++ D++ G++ e+++ h+(++) r? y---? UF++++
------END GEEK CODE BLOCK------