2016-04-14 17:29 GMT+02:00 Ethan Furman <ethan at stoneleaf.us>: > Interoperability with other systems and/or libraries. If we use > surrogateescape to transform str to bytes, and the other side does not, we > no longer have a workable path. I guess that you mean a Python library? When you exchange with external programs or call a C libraries, Python is responsible to encode Unicode to bytes with os.fsencode(). The external part is not aware that Python uses surrogateescape, it gets "regular" bytes. I suggest to consider such Python library as external programs and libraries: convert Unicode to bytes with os.fsencode(), but also process paths as Unicode "inside" your application. It's the basic rule to handle correctly Unicode in an application: decode inputs as soon as possible, and encode back as late as possible. Encode/decode at borders. Victor
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4