Commits

Show all
Author Commit Message Labels Comments Date
INADA Naoki
Fix wrapping stat module.
INADA Naoki
Wrap more functions. Make tounicode to accept 'mbcs' encoded str.
INADA Naoki
wrap os.path.realpath and os.path.relpath
INADA Naoki
Use WriteFile() if failed to decode str.
INADA Naoki
Use WriteFile if stdout is not console.
INADA Naoki
Don't join args.
Naoki INADA
Use WriteConsoleW instead of SetConsoleOutputCP
Stefan Rusek
wrap some stragglers
Stefan Rusek
Avoid an unessesary encode
Stefan Rusek
We now go to great lengths to avoid using the utf8 locale.
Stefan Rusek
Only call GetConsoleOutputCP once per write
Stefan Rusek
Make hg-fixutf8 compatible with hg 1.2 (while retaining compatibility with hg 1.1)
Shun-ichi Goto
Do not change codepage if no need. Changing code page on every writing causes: * flushing and performance-loss by font switching, etc. * breakage of exisintg mbcs texts. (it might be a bug of cmd.exe or 4nt.exe) So we try converting utf-8 text into local encoding, then change code page only when conversion failed.
Stefan Rusek
fix a bug caused by latin1 filenames in a repo * s.encode('utf-8', 'ignore').decode('utf-8', 'ignore') is lossless, so take advantage of that * some of the os.path functions are encoding agnostic, so don't do useless extra encodings.
Stefan Rusek
Removed all the wrappers to tolocal and fromlocal, instead we just set _encoding to utf8. * I also broke out the win32 stuff out into its own file * use a copy of osutil.py instead of incorporating the files contents into fixutf8
Stefan Rusek
WriteFile only returns FALSE when it either fails or it did not write the number of bytes requested. So we need to handle that situation properly.
Stefan Rusek
Use ctypes to call the proper WIN32 apis
Stefan Rusek
When writing to a buffer instead of a stream we want to keep the data in utf8
Stefan Rusek
wrap calls to i18n.gettext() This is the naive approach if this turns out to be too slow we can switch to the smarter approach, the reason why the naive approach is preferred is that it results in less duplicated code.
Stefan Rusek
fixutf8 module This module automatically converts filenames to UTF-8 internally on systems where the default codepage is something other than UTF-8. Until recently it was common to set the codepage to latin1 on linux, and Windows does not support setting the default codepage to UTF-8 at all.