[Seaside-dev] testCodecLatin1 and testCodecUtf8Bom
Michael Lucas-Smith
mlucas-smith at cincom.com
Fri May 14 23:19:32 UTC 2010
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).
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
Cheers,
Michael
More information about the seaside-dev
mailing list