[Tutor] slashes in paths

eryksun eryksun at gmail.com
Mon Jul 22 23:34:14 CEST 2013


On Mon, Jul 22, 2013 at 3:48 PM, Marc Tompkins <marc.tompkins at gmail.com> wrote:
>
> You'd be better off skipping TREE entirely and going pure-Python.  TREE -
> being Unicode-naive - can't deal with any foreign-alphabet characters beyond
> the few baked in alongside the box-drawing characters; they all get turned
> into question marks.  I'm guessing that's not an issue on your own computer,
> but if you ever want to deal with files from other people...

Just to clarify, tree isn't completely Unicode naive. It writes
Unicode to the console, presuming you're using a font that supports
it, such as Consolas.

The problem is that it doesn't configure ULIB to use the current
console code page when streaming to a pipe or file. It leaves it at
the default setting, which is to encode Unicode to the OEM code page
(e.g. 437). If it would use the current code page instead, you could
try setting it to 65001 (a somewhat-buggy UTF-8 code page). Streaming
the UTF-16 directly (like cmd's /U option) would be even better, but
that would require modifying ULIB.

That said, I doubt anyone at Microsoft cares. It's a dinky utility
written back in the early 90s. Probably no one has even looked at the
code in years.


More information about the Tutor mailing list