UTF-8 Streams

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

UTF-8 Streams

Ole Voß
Hi,

I don't really know which list to post this on, since I'm having difficulties with Seaside and Squeak concerning string encoding.
I think that I may have a possible solution but desperatly need some help on string encoding/converting issues. Can anybody point me toward a good site / document / book that explains how Squeak (3.10.2) handles ByteStrings / WideStrings and how to convert them to and from UTF-8?

Many regards,

Ole Voß._______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: [Newbies] UTF-8 Streams

Ole Voß
Uhm, ok, I get it ;-)

I'll rephrase that... how do I ensure that a UTF-8 textfile will be read and recognised as such using Squeak (or Pharo) smalltalk? I was expecting some sort of decoding mechanisms or a method of telling Squeak this String or Stream is now utf-8.

A hint? Anybody? Please? Pretty Please?

Ole.


On Jan 19, 2010, at 10:22 PM, Ole Voß wrote:

> Hi,
>
> I don't really know which list to post this on, since I'm having difficulties with Seaside and Squeak concerning string encoding.
> I think that I may have a possible solution but desperatly need some help on string encoding/converting issues. Can anybody point me toward a good site / document / book that explains how Squeak (3.10.2) handles ByteStrings / WideStrings and how to convert them to and from UTF-8?
>
> Many regards,
>
> Ole Voß._______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: [Newbies] UTF-8 Streams

Bert Freudenberg
On 21.01.2010, at 18:08, Ole Voß wrote:
>
> Uhm, ok, I get it ;-)
>
> I'll rephrase that... how do I ensure that a UTF-8 textfile will be read and recognised as such using Squeak (or Pharo) smalltalk? I was expecting some sort of decoding mechanisms or a method of telling Squeak this String or Stream is now utf-8.
>
> A hint? Anybody? Please? Pretty Please?

        aStream converter: UTF8TextConverter new.

(which in Squeak is the default nowadays, just inspect a new file stream ...)

- Bert -


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: [Newbies] UTF-8 Streams

Ole Voß

On Jan 21, 2010, at 7:12 PM, Bert Freudenberg wrote:

> On 21.01.2010, at 18:08, Ole Voß wrote:
>>
>> Uhm, ok, I get it ;-)
>>
>> I'll rephrase that... how do I ensure that a UTF-8 textfile will be read and recognised as such using Squeak (or Pharo) smalltalk? I was expecting some sort of decoding mechanisms or a method of telling Squeak this String or Stream is now utf-8.
>>
>> A hint? Anybody? Please? Pretty Please?
>
> aStream converter: UTF8TextConverter new.
>
> (which in Squeak is the default nowadays, just inspect a new file stream ...)
>
> - Bert -

Thank you Bert! Although the above didn't work as such, it set me on the right track!

This solution worked for me:
stream := MultiByteFileStream readOnlyFileNamed: commentfilepath.

I'm fairly new to smalltalk, so thank you for bearing with me :-)

Ole._______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners