Message9432
1) I'm fine with getting and setting environment variables, cli arguments, etc. as Unicode on Jython. With Jython only code it would avoid the need to actually know the system encoding, and compatibility with CPython only requires one 'if' to decide is encoding/decoding needed.
2) Getting system encoding with Python is surprisingly complicated. With Robot Framework we get the encoding that is got first using these alternatives in this order:
- Any: sys.getfilesystemencoding()
- Jython: System.getProperty('file.encoding')
- POSIX: Environment variables LANG, LC_CTYPE, LANGUAGE, and LC_ALL
- Windows: ctypes.cdll.kernel32.GetACP()
Here's the code for anyone interested: https://github.com/robotframework/robotframework/blob/master/src/robot/utils/encodingsniffer.py
3) If there's a reliable way to get the correct encoding, I'd prefer sys.getfilesystemencoding() to return it.
4) The test that requires double decoding definitely looks wrong. |
|
Date |
User |
Action |
Args |
2015-01-21 01:23:12 | pekka.klarck | set | messageid: <1421803392.65.0.86523122175.issue1841@psf.upfronthosting.co.za> |
2015-01-21 01:23:12 | pekka.klarck | set | recipients:
+ pekka.klarck, fwierzbicki, amak, zyasoft |
2015-01-21 01:23:12 | pekka.klarck | link | issue1841 messages |
2015-01-21 01:23:11 | pekka.klarck | create | |
|