[Pharo-project] Write accentuate characters in file

Henrik Sperre Johansen henrik.s.johansen at veloxit.no
Mon May 16 17:01:30 CEST 2011


On 16.05.2011 16:42, Adrien BARREAU wrote:
> Hello,
>
> A small question I have: how can I write a "é" character in a file and 
> >really< get it in Mac OS?
> I tried with:
>
>   FileStream newFileNamed: 'test.txt' do: [ :each | each nextPutAll: 
> 'ééé' ]
>
> and got: 'ééé'.
>
> I also tried with FileSystem and got : 'ÈÈÈ'.
>
> I do not see another way to do that ...
>
>
> Regards,
> Adrien.
FileStream newFileNamed: 'test.txt' do: [ :stream |
     stream converter: MacRomanTextConverter new; " or: TextConverter 
newForEncoding: 'mac-roman' "
     nextPutAll: 'ééé' ].

Cheers,
Henry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gforge.inria.fr/pipermail/pharo-project/attachments/20110516/75392b0f/attachment.htm>


More information about the Pharo-project mailing list