Re: Conversion of =E? string
Re: Conversion of =E? string
- Subject: Re: Conversion of =E? string
- From: "Shawn Erickson" <email@hidden>
- Date: Thu, 28 Sep 2006 10:33:13 -0700
On 9/28/06, malcom <email@hidden> wrote:
Hello I've a string like
"bla bla =E8 bla" to "bla bla è bla"
is this UTF-8? How is possible to convert automatically these strings?
It helps to look at the actual byte values to understand what is going
on (if you don't know the encoding of the string). From what you
posted it isn't clear if you get "bla bla =E8 bla" as the characters
in your string buffer or if that is what you think your string is
based on some software interpretation of the string buffer you have...
please clarify.
The character è in UTF-16 is 0x00E8, in UTF-8 is 0xC3 0xA8, and in
ISO-8859-1 is 0xE8, etc. As a quick note the character palette built
into Mac OS X (10.4 version is best so far) is a great tool to explore
Unicode code points, etc.
If you know the encoding you can tell NSString that when you construct
your NSString instance... see +[NSString stringWithCString:encoding:]
and friends that take the encoding parameter.
<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/Reference.html#//apple_ref/occ/clm/NSString/stringWithCString:encoding:>
Again it isn't clear what you string you really have to work with ...
it could be that you have a string that is escaped in some fashion and
you need to unescape it to get it into a proper encoding before you
can use it.
-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden