Hi Sven,

thank you very much for your explanation. I will read the pharo book chapter again tomorrow morning.��
Each time I have to do with encoding, I have to start again with reading....;-(

I was not asking for the reason of encoding but because��OSProcess command: needs a String and not a Byte Array. But yes, sure, first encode it and then convert it back to a string.

Regards and a nice evening
Sabine

2016-06-06 19:57 GMT+02:00 Sven Van Caekenberghe-2 [via Smalltalk] <[hidden email]>:

> On 06 Jun 2016, at 17:22, Sabine Manaa <[hidden email]> wrote:
>
> why ByteArray?

http://www.unicode.org/faq/utf_bom.html

A Unicode transformation format (UTF) is an algorithmic mapping from every Unicode code point (except surrogate code points) to a unique byte sequence.

https://en.wikipedia.org/wiki/UTF-8

UTF-8 encodes each of the 1,112,064 valid code points in the Unicode code space (1,114,112 code points minus 2,048 surrogate code points) using one to four 8-bit bytes (a group of 8 bits is known as an octet in the Unicode Standard).

In Pharo

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

Of course, given a ByteArray, whose values are all between 0 and 255 by definition, you can convert it to a ByteString. That String is not a correct (Pharo) String anymore, it is like converting a PNG or JPEG to String, you can do it, it is just wrong.

When talking to the outside world, be it over a network connection, or via primitive calls, anything but pure ASCII strings need an encoding. This has to be agreed upon by both parties. If the receiving party wants UTF-8 forced into a (kind of) String, that is (still) possible.

Your initial solution seems to indicate that this is expected. This (ugly) conversion should be done at an as low level as possible, IMHO.

Sven





If you reply to this email, your message will be added to the discussion below:
http://forum.world.st/OSProcess-command-with-german-umlaut-does-not-work-tp4899285p4899446.html
To start a new topic under Pharo Smalltalk Users, email [hidden email]
To unsubscribe from Pharo Smalltalk Users, click here.
NAML



View this message in context: Re: OSProcess command with german umlaut does not work
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.