On Jan 30, 9:05 am, "Edward K. Ream" <[email protected]> wrote:

> More dubiously, the encoding used to compute standard directory names
> during startup is also always 'utf-8', regardless of platform.
> Previously, the encoding for Windows was 'mbcs'.

I just ran the following script in test.leo, with both @first lines,
and no @first line. In all cases, the code appears to work. That is,
the script prints the path properly to the console, and
g.os_path_exists reports True. So it appears that g.startupEncoding
can always return 'utf-8', or equivalently, we can dispense with the
"startup encoding" logic altogether

# @first # -*- coding: mbcs -*-
# @first # -*- coding: utf-8 -*-

path = 'c:\prog\Leo Stuff\chinese脖folder'

for encoding in ('mbcs','utf-8'):
    valid = g.isValidEncoding(encoding)
    theDir = g.os_path_finalize(path,encoding='utf-8')
    g.es(encoding,valid,theDir)
    print(encoding,valid,g.os_path_exists(theDir))

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to