String, ByteString and WideString

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

String, ByteString and WideString

Andrey Larionov
Working with WebClient i found what it lacks of non latin languages
support (for example Russian). During investigation i found, what for
streaming there used ByteString, which is custructed by calling String
class>>new:. All subclases of String by calling of this method
produces only ByteString instances. Also WriteStream>>contents
indirectly calls String class>>new:. So even you construct WideString
with #basicNew: calling
(WideString basicNew: size) writeStrem contents
produce only ByteString

Is this a bug or there some workaround?

Thanks.

--
Andrey Larionov

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: String, ByteString and WideString

Stéphane Ducasse
andrey

can you post the mail to squeak since andreas read it more than this mailing-list I imagine.

Stef

On Aug 1, 2010, at 1:56 AM, Andrey Larionov wrote:

> Working with WebClient i found what it lacks of non latin languages
> support (for example Russian). During investigation i found, what for
> streaming there used ByteString, which is custructed by calling String
> class>>new:. All subclases of String by calling of this method
> produces only ByteString instances. Also WriteStream>>contents
> indirectly calls String class>>new:. So even you construct WideString
> with #basicNew: calling
> (WideString basicNew: size) writeStrem contents
> produce only ByteString
>
> Is this a bug or there some workaround?
>
> Thanks.
>
> --
> Andrey Larionov
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: String, ByteString and WideString

Philippe Marschall-2-3
In reply to this post by Andrey Larionov
On 01.08.2010 01:56, Andrey Larionov wrote:
> Working with WebClient i found what it lacks of non latin languages
> support (for example Russian). During investigation i found, what for
> streaming there used ByteString, which is custructed by calling String
> class>>new:. All subclases of String by calling of this method
> produces only ByteString instances. Also WriteStream>>contents
> indirectly calls String class>>new:. So even you construct WideString
> with #basicNew: calling
> (WideString basicNew: size) writeStrem contents
> produce only ByteString

You probably want one of the MultiByteStreams and then set either the
encoding or the converter.

Cheers
Philippe


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: String, ByteString and WideString

Andrey Larionov
maybe, but i'm thinking what
(WideString basicNew: size) writeStrem contents
should return WideString, not the ByteString

On Sun, Aug 1, 2010 at 17:48, Philippe Marschall <[hidden email]> wrote:

> On 01.08.2010 01:56, Andrey Larionov wrote:
>> Working with WebClient i found what it lacks of non latin languages
>> support (for example Russian). During investigation i found, what for
>> streaming there used ByteString, which is custructed by calling String
>> class>>new:. All subclases of String by calling of this method
>> produces only ByteString instances. Also WriteStream>>contents
>> indirectly calls String class>>new:. So even you construct WideString
>> with #basicNew: calling
>> (WideString basicNew: size) writeStrem contents
>> produce only ByteString
>
> You probably want one of the MultiByteStreams and then set either the
> encoding or the converter.
>
> Cheers
> Philippe
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project