Hi Dave, Sabine, Norbert et all, Few weeks (months?) ago I was also reviewing this topic of encoding a OS(Sub)Process. After surfing a bit the web, I found out the most simple and accurate answer/solution was indeed to set the correct locale and/or text encoding in the computer in question. Anyway...more answers below.
Now... what I don't understand from Sabine is.. she said this one works: OSProcess command: ('cp /Library/WebServer/Documents/reports/bär.pdf /Library/WebServer/Documents/reports/test-a.pdf' utf8Encoded) *But then my question is...does that work only because she's computer locale is UTF8? Or Unix* automatically decodes it and knows it is utf8?* *If not...should I adapt the #utf8Encoded to the encoding defined by the terminal? mmm* In my OSX box I do have UTF8 set: ❯ locale [13:56:49] LANG="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_CTYPE="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_ALL= On Mon, Jun 6, 2016 at 1:42 PM, David T. Lewis <le...@mail.msen.com> wrote: > Norbert, > > You are probably right. I'm not sure the best way to handle it. > > Dave > > > Dave, > > > >> Am 06.06.2016 um 18:13 schrieb David T. Lewis <le...@mail.msen.com>: > >> > >> Hi Sabine, > >> > >> That's great that #utf8Encoded is working, thanks for confirming. > >> > >> I'll look and see if I can add that to OSProcess (I'm traveling and > >> cannot > >> look at it right now). > >> > >> Mariano - this thread probably applies to OSSubProcess also. > >> > > that would just work if the system locale is utf8, right? Wouldn't it be > > better to making that a setting? > > > > Norbert > > > >> Dave > >> > >>> Hi Sven, > >>> > >>> why ByteArray? > >>> > >>> does not work (Improper store into indexable object): > >>> OSProcess command: ('cp > >>> /Library/WebServer/Documents/reports/bär.pdf > >>> /Library/WebServer/Documents/reports/test-a.pdf' utf8Encoded asString). > >>> > >>> works: > >>> OSProcess command: ('cp > >>> /Library/WebServer/Documents/reports/bär.pdf > >>> /Library/WebServer/Documents/reports/test-a.pdf' utf8Encoded) > >>> > >>> Perhaps David can add this here: > >>> > >>> command: aCommandString > >>> "Run a command in a shell process. Similar to the system(3) call in the > >>> standard C library, > >>> except that aCommandString runs asynchronously in a child process. The > >>> command is > >>> run by a ConnectedUnixProcess in order to facilitate command pipelines > >>> within Squeak." > >>> > >>> "UnixProcess thisOSProcess command: 'ls -l /etc'" > >>> > >>> | proc | > >>> pid isNil > >>> ifTrue: > >>> [self class noAccessorAvailable. ^nil] > >>> ifFalse: > >>> [proc := self > >>> forkJob: ExternalUnixOSProcess defaultShellPath > >>> arguments: (Array with: '-c' with: aCommandString utf8Encoded asString) > >>> <<<=== > >>> environment: nil > >>> descriptors: nil. > >>> proc ifNil: [self class noAccessorAvailable]. > >>> ^ proc] > >>> > >>> > >>> regards > >>> Sabine > >>> > >>> > >>>> > >>>> > >>> > >>> 2016-06-06 8:41 GMT+02:00 Sabine Manaa <manaa.sab...@gmail.com>: > >>> > >>>> Hi Dave, > >>>> > >>>> I get the german ä with: > >>>> > >>>> (Character value: 228) asString > >>>> > >>>> Do you want me to go in it and suggest a solution or do you want to > >>>> try > >>>> to > >>>> fix it and I test it? > >>>> > >>>> Thanks for helping! > >>>> > >>>> Regards Sabine > >>>> > >>>> 2016-06-05 23:08 GMT+02:00 David T. Lewis [via Smalltalk] <[hidden > >>>> email] > >>>> <http:///user/SendEmail.jtp?type=node&node=4899318&i=0>>: > >>>> > >>>>> > >>>>> > >>>>> ------------------------------ > >>>>> 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-tp4899285p4899301.html > >>>>> To start a new topic under Pharo Smalltalk Users, email [hidden > >>>>> email] > >>>>> <http:///user/SendEmail.jtp?type=node&node=4899318&i=1> > >>>>> To unsubscribe from Pharo Smalltalk Users, click here. > >>>>> NAML > >>>>> < > http://forum.world.st/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml > > > >>>>> > >>>> > >>>> > >>>> ------------------------------ > >>>> View this message in context: Re: OSProcess command with german umlaut > >>>> does not work > >>>> < > http://forum.world.st/OSProcess-command-with-german-umlaut-does-not-work-tp4899285p4899318.html > > > >>>> Sent from the Pharo Smalltalk Users mailing list archive > >>>> <http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html> at > >>>> Nabble.com. > >>>> > >>> > >> > >> > >> > > > > > > > > -- Mariano http://marianopeck.wordpress.com