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] < ml-node+s1294792n4899446h21@n4.nabble.com>:
On 06 Jun 2016, at 17:22, Sabine Manaa <[hidden email] <http:///user/SendEmail.jtp?type=node&node=4899446&i=0>> 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/lastSuccessfu...
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-tp4... To start a new topic under Pharo Smalltalk Users, email ml-node+s1294792n1310670h65@n4.nabble.com To unsubscribe from Pharo Smalltalk Users, click here <http://forum.world.st/template/NamlServlet.jtp?macro=unsubscribe_by_code&nod...> . NAML <http://forum.world.st/template/NamlServlet.jtp?macro=macro_viewer&id=instant...>
-- View this message in context: http://forum.world.st/OSProcess-command-with-german-umlaut-does-not-work-tp4... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.