On Sun, Jun 3, 2012 at 6:36 PM, Sébastien Doeraene
<sjrdoera...@gmail.com> wrote:
> On Sun, Jun 3, 2012 at 11:50 AM, Kenny TM~ <kenn...@gmail.com> wrote:
>>
>> Sorry I do not quite understand where do the duplicate comes from. Does
>> that
>> mean like we have a normal VirtualString.toString and a for-compatibility
>> VirtualString.toListOfIntegersWhichAreUnicodeCodePoints?
>
>
> Yes and no. We'd need the compatibility VirtualString.toString that returns
> a list of ASCII integers. And a new one VirtualString.toUnicodeString (or
> whatever it's called) that returns a new String value.
>

I see. But not every Unicode character is representable in ISO-8859-1,
so how will they be represented? Replaced by '?'?

> Unfortunately we need old names to return old values. We may add new names
> that return new values.
>
>>
>> > And then, of course, I have procedures to encode/decode a String as a
>> > ByteString (and/or a List of Characters as a List of Bytes), according
>> > to a
>> > certain encoding.
>>
>> Actually this is one of my concern, which encoding will be chosen when one
>> call
>> this?
>>
>>    BS = {ByteString.make 'aáā𝓪'}
>>
>> In UTF-8 it will produce [0x61  0xc3 0xa1  0xc4 0x81  0xf0 0x9d 0x93
>> 0xaa], and
>> in UTF-16BE it will produce [0x00 0x61  0x00 0xe1  0x01 0x01  0xd8
>> 0x35 0xdc 0xea].
>> This encoding is relevant because it will affect the result of e.g.
>> ByteString.get.
>
>
> That call would not exist. You would need to explicitly specify the encoding
> you want, for example:
> BS = {ByteString.make 'aáā𝓪' utf8}
> or something like this:
> BS = {UTF8Encode 'aáā𝓪'}
> or what know I ...
>
> There is no such thing as a default encoding in the "nature", anyway.
>
[snip]
>
> Cheers,
> Sébastien
>
> _________________________________________________________________________________
> mozart-hackers mailing list
> mozart-hackers@mozart-oz.org
> http://www.mozart-oz.org/mailman/listinfo/mozart-hackers

OK. But {ByteString.make +V +Encoding ?ByteString} breaks old code [4]
which has {ByteString.make +V ?ByteString}.

[4]: http://www.mozart-oz.org/documentation/base/bytestring.html
_________________________________________________________________________________
mozart-hackers mailing list                           
mozart-hackers@mozart-oz.org
http://www.mozart-oz.org/mailman/listinfo/mozart-hackers

Reply via email to