Max,
That is because you are using the wrong encoders.
> On 02 Mar 2016, at 19:57, Max Leske <maxleske@gmail.com> wrote:
>
> Just so I don���t forget: this test fails (since at least 1.3). I have determined the correct value (175) independently with the respective tables and by using uconv.
>
> testConversionToFrom
>�� �� �� ��self assert: (('������' convertToEncoding: 'mac-roman') convertFromEncoding: 'mac-roman') = '������'.
>�� �� �� ��self
>�� �� �� �� �� �� �� ��assert: ((Character value: 216) asString convertToEncoding: 'mac-roman')
>�� �� �� �� �� �� �� ��equals: (Character value: 175) asString
>
> As far as I can tell, this flaw is not exclusive to the mac-roman encoding. However, latin1 and UTF8 are probably fine.
>
> Max
| encoder string |
encoder := #macroman asZnCharacterEncoder.
string := '������'.
(encoder decodeBytes: (encoder encodeString: string)) = string. " => true"
encoder encodeString: (Character value: 216) asString. " => #[175]"
We should probably replace the old ones with the newer ones in Pharo 6.
Regards,
Sven