Re: [Wrapl-discussion] Feedback on Wrapl-1.9-1074 for Windows
Brought to you by:
rajamukherji
|
From: Raja M. <raj...@gm...> - 2010-06-01 15:41:47
|
On 1 June 2010 12:26, Roman Mishin <rom...@gm...> wrote:
> > It is not necessary to use Out:write to show the results in Interactive
> > Wrapl, the results of a calculation are automatically displayed (and
> stored
> > in a variable called "_"). If you use Out:write(...) then the final
> result
> > is whatever is returned by Out:write(...) which is Out, which the
> > interactive interpreter resolves to be /usr/lib/IO/Terminal.Out.
>
> OK. Now I understand why it is outputted.
> I used Out:write(...) because otherwise the result with foreign
> characters is not informative:
> --> ALL s[5] | s[6] | s[7];
> ["\xAA", "\xA8", "\xA9"]
> But Out:write(...) somehow makes it right :)
>
Ah, the interactive interpreter tries to display the result as a string
that could appear in Wrapl code, so that UTF-8 characters in strings are
turned into escape sequences. I'll have a look about changing this
behaviour.
> > Currently Wrapl strings are only considered as arrays of single bytes
> >
> > --> "б":length;
> > 2
>
> On Windows in console I tried this:
> --> "б":length;
> 1
> --> "я":length;
> 1
> then created UTF-8 file with Out:write("б":length);
> C:\Home>riva utf.wrapl
> 2
>
>
That's interesting. Maybe you are using a different codepage and not UTF-8
in the console so that "б" is 1 byte in the console but 2 bytes in a UTF-8
file?
>
> > I think a set of UTF-8 aware methods or a subtype of String.T which is
> UTF-8
> > aware is probably necessary.
>
> I do not know of UTF internals and do not force you to make the
> decision based on the following text, however:
> About three month ago I studied GT.M (an open-source MUMPS
> implementation). They are using ICU library for the purpose to employ
> UTF-8. I saw the site http://icu-project.org/ . The library is quite
> extensive (and comprehensive). It rather big in size.
> Looking at GT.M: an interesting point is that during installation
> process GT.M allows to choose to install or not to install UTF
> support. GT.M distribution itself does not contain this library,
> rather it relies on ICU packages that are provided for the most Linux
> distributions. I saw it in the repositories of all distros I tried:
> ArchLinux, ZenLinux, Debian and even TinyCoreLinux.
>
>
Thanks, I will have a look at this.
>
> --
> Roman
>
Raja
|