[squeak-dev] problem with accent characters in fileIn (squeak 5.3)

David T. Lewis lewis at mail.msen.com
Sun Nov 6 18:23:00 UTC 2022


Hello Andr??,

On Sun, Nov 06, 2022 at 01:08:00PM +0100, BERTRAND AJ wrote:
> l???m new on this list, so sorry if i am not in the correct use.
> 

Yes, this is the right list, and thank you for contributing.


> I have problems with accent characters in fileOut and subsequent fileIn 
> (??????) because i'm French
> 
> It seems that Squeak saves fileOut files always in UTF8 now, but uses a 
> converter not UTF8 for the fileIn.
> 
> With the following modification it works for me, but i did not try all 
> cases so...

You are right that UTF8 conversion in required. There is actually
a fix for this issue in the newer Squeak 6.0 release, but it is
part of a much larger set of changes so I do not know if it is
easy to back port to Squeak 5.3.

Maybe Marcel Taeumel can comment. Marcel, would it make sense to
back port just the MultiByteFileStream>>setConverterForCode method
to the Squeak53 repository? To avoid name collision with trunk we might
want to commit it as a "branch" (e.g. "Multilingual.backport-xyz.254")
with an update map entry, I can help with that if you think it is a
good idea to backport the method.

Dave


> 
> The modif is :
> 
> MultiByteFileStream >> setConverterForCode
> setConverterForCode
> ???? ??| currentPosition |
> ???? ??(SourceFiles at: 2)
> ???? ???????? ifNotNil: [self fullName = (SourceFiles at: 2) fullName 
> ifTrue: [^ self]].
> ???? ??"currentPosition := self position.
> ???? ??self position: 0.
> ???? ??self binary.
> ???? ??((self next: 3) = #[ 16rEF 16rBB 16rBF ]) ifTrue: ["
> ???? ???????? self converter: UTF8TextConverter new
> ???? ??"] ifFalse: [
> ???? ???????? self converter: MacRomanTextConverter new.
> ???? ??].
> ???? ??self position: currentPosition."
> ???? ??self text.
> 
> with this modification, Squeak will always use UTF8TextConverter
> 
> -- 
> Andr?? Jacques BERTRAND,
> 
> 


More information about the Squeak-dev mailing list