Re: Encodings problem
Re: Encodings problem
- Subject: Re: Encodings problem
- From: Chris Ridd <email@hidden>
- Date: Wed, 10 Sep 2003 15:14:14 +0100
On 10/9/03 2:47 pm, TACKEL <email@hidden> wrote:
>
Hi,
>
>
Im trying to write some text (with Spanish accentuated words) to a file but
>
Im having
>
some encoding problems. I think Ive tried all the possible encodings but the
>
string
>
wasnt write properly. More or less this is what Im doing:
>
>
---------------------------------------------------------------
>
NSFileHandle *filehandle;
>
>
>
[filemng createFileAtPath: [@"~/Desktop/file.txt"
>
stringByExpandingTildeInPath]
>
contents: nil attributes: nil ];
>
>
filehandle = [NSFileHandle fileHandleForWritingAtPath : [@"~/Desktop/file.txt"
>
stringByExpandingTildeInPath]];
>
>
[filehandle writeData: [@"el camisn elictrico"
>
dataUsingEncoding:NSUTF8StringEncoding]];
The @"..." notation in Obj C can only contain 7-bit characters. There are a
couple of workarounds in the list archives at <
http://cocoa.mamasam.com/>.
Cheers,
Chris
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.