bytes to utf8 string / byte stream parsing

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

bytes to utf8 string / byte stream parsing

Fabrice Leal
can anyone provide me some pointers on how to turn a bunch of bytes into a utf8 string?

i'm planning on writing a byte stream parser, would appreciate anything you might find useful in addition to the Streams chapter from Pharo by Example

--
---
Fabrice Leal
Reply | Threaded
Open this post in threaded view
|

Re: bytes to utf8 string / byte stream parsing

Fabrice Leal
ah i think i found it

bytes decodeWith: 'utf8'.

On Fri, Sep 30, 2016 at 11:57 AM, Fabrice Leal <[hidden email]> wrote:
can anyone provide me some pointers on how to turn a bunch of bytes into a utf8 string?

i'm planning on writing a byte stream parser, would appreciate anything you might find useful in addition to the Streams chapter from Pharo by Example

--
---
Fabrice Leal



--
---
Fabrice Leal
Reply | Threaded
Open this post in threaded view
|

Re: bytes to utf8 string / byte stream parsing

Sven Van Caekenberghe-2
In reply to this post by Fabrice Leal
Hi Fabrice,

'élève en Français' utf8Encoded.

#[195 169 108 195 168 118 101 32 101 110 32 70 114 97 110 195 167 97 105 115] utf8Decoded.

Read https://ci.inria.fr/pharo-contribution/job/EnterprisePharoBook/lastSuccessfulBuild/artifact/book-result/Zinc-Encoding-Meta/Zinc-Encoding-Meta.html

Sven

> On 30 Sep 2016, at 12:57, Fabrice Leal <[hidden email]> wrote:
>
> can anyone provide me some pointers on how to turn a bunch of bytes into a utf8 string?
>
> i'm planning on writing a byte stream parser, would appreciate anything you might find useful in addition to the Streams chapter from Pharo by Example
>
> --
> ---
> Fabrice Leal


Reply | Threaded
Open this post in threaded view
|

Re: bytes to utf8 string / byte stream parsing

stepharo
In reply to this post by Fabrice Leal

Hello Fabrice

Did you read the excellent book chapter written by sven on stream encodings?

Check Enterprise Pharo book http://books.pharo.org

Now can you tell us what you want to do?

It would be nice also to check if Xtreams offers (or deserves some extensions).

Stef


Le 30/9/16 à 12:57, Fabrice Leal a écrit :
can anyone provide me some pointers on how to turn a bunch of bytes into a utf8 string?

i'm planning on writing a byte stream parser, would appreciate anything you might find useful in addition to the Streams chapter from Pharo by Example

--
---
Fabrice Leal

Reply | Threaded
Open this post in threaded view
|

Re: bytes to utf8 string / byte stream parsing

Fabrice Leal
hey! yeah, i checked it, it seems to solve my issue but i havent test it yet. i have a custom binary format that i want to parse, and was looking for a way for reading a utf8 string as encoded by c# (where i generate files with this format).

gotta check that Xtreams thing

On Mon, Oct 3, 2016 at 6:39 AM, stepharo <[hidden email]> wrote:

Hello Fabrice

Did you read the excellent book chapter written by sven on stream encodings?

Check Enterprise Pharo book http://books.pharo.org

Now can you tell us what you want to do?

It would be nice also to check if Xtreams offers (or deserves some extensions).

Stef


Le 30/9/16 à 12:57, Fabrice Leal a écrit :
can anyone provide me some pointers on how to turn a bunch of bytes into a utf8 string?

i'm planning on writing a byte stream parser, would appreciate anything you might find useful in addition to the Streams chapter from Pharo by Example

--
---
Fabrice Leal




--
---
Fabrice Leal