Hi, Reading an utf8 file with OSProcess results in some weird characters showing up. (PipeableOSProcess command: 'less /path/to/a/text/file') output. -> inspect the bytestring and get some non-ascii characters fucked up. Doing `less /path/to/a/text/file` in a terminal displays the file fine. That's probably something stupid on my side but I cannot get it working. Any idea ? Cheers, Francois
On Sat, Nov 19, 2011 at 06:19:59PM -0800, Francois Stephany wrote:
Hi,
Reading an utf8 file with OSProcess results in some weird characters showing up.
(PipeableOSProcess command: 'less /path/to/a/text/file') output. -> inspect the bytestring and get some non-ascii characters fucked up.
Doing `less /path/to/a/text/file` in a terminal displays the file fine.
That's probably something stupid on my side but I cannot get it working. Any idea ?
Francois, The output of the PipeableOSProcess is based on a StandardFileStream rather than a MultiByteFileStream, so it may not do what you expect with a file containing non-ascii characters. Note that the unix /usr/bin/less utility is intended for interactive use with a terminal. You probably should use /usr/bin/cat instead. HTH, Dave
Hi Dave, Ok! I'll try to get it work... Yep 'less' was an example, I'm actually wrapping the exiftool perl library... Francois On Nov 20, 2011 6:30 AM, "David T. Lewis" <lewis@mail.msen.com> wrote:
On Sat, Nov 19, 2011 at 06:19:59PM -0800, Francois Stephany wrote:
Hi,
Reading an utf8 file with OSProcess results in some weird characters showing up.
(PipeableOSProcess command: 'less /path/to/a/text/file') output. -> inspect the bytestring and get some non-ascii characters fucked up.
Doing `less /path/to/a/text/file` in a terminal displays the file fine.
That's probably something stupid on my side but I cannot get it working. Any idea ?
Francois,
The output of the PipeableOSProcess is based on a StandardFileStream rather than a MultiByteFileStream, so it may not do what you expect with a file containing non-ascii characters.
Note that the unix /usr/bin/less utility is intended for interactive use with a terminal. You probably should use /usr/bin/cat instead.
HTH, Dave
participants (3)
-
David T. Lewis -
Francois Stephany -
François Stephany