[Seaside-dev] testCodecLatin1 and testCodecUtf8Bom

Philippe Marschall philippe.marschall at gmail.com
Sun May 16 13:00:36 UTC 2010


2010/5/15 Michael Lucas-Smith <mlucas-smith at cincom.com>:
> Hi All,
>
> #testCodecLatin1 and #testCodecUtf8Bom fail for me on VisualWorks.. once the
> Unicode string is created, #asByteArray is sent to it to "turn it back to
> bytes" but of course this is impossible, it's already a TwoByteString in
> VisualWorks and to turn that back to bytes, you need to specify an encoding
> using #asByteArrayEncoding: 'utf-8' (for example).

You're right, looking at it again, using #asByteArray seems
problematic due to it's underspecified nature.

> Can these tests be written with a custom compare operation? the comment in
> #testCodecLatin1 explains the problem - that comparing unicode strings using
> #= is not necessarily going to work across platforms, but perhaps something
> like this might work everywhere:
>
> compare: a with: b
>   a size = b size ifFalse: [^false].
>   1 to: a size do: [:index | (a at: index) = (b at: index) ifFalse:
> [^false]].
>   ^true

If that works with everybody, sure.

Cheers
Philippe


More information about the seaside-dev mailing list