Bug 689448
| Summary: | RFE: Accept unicode in python bindings | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Miroslav Suchý <msuchy> |
| Component: | newt | Assignee: | Miroslav Lichvar <mlichvar> |
| Status: | CLOSED UPSTREAM | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | low | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | rawhide | CC: | mlichvar |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-07-27 13:24:52 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Miroslav Suchý
2011-03-21 14:51:50 UTC
I spent some time investigating this. And the cause is best described here: http://docs.python.org/c-api/arg.html s (string or Unicode) [const char *]...Unicode objects are converted to C strings using the *default encoding*... (emphasis is mine) And problem with default encoding is best described here: http://fedoraproject.org/wiki/Features/PythonEncodingUsesSystemLocale And in mailing thread: http://thread.gmane.org/gmane.comp.python.devel/109914 So one solution is to put into snackmodule.c: PyUnicode_SetDefaultEncoding("utf-8"); but that is probably wrong approach. Second option is to put at the begging each function of snack.py this: if isinstance(text, unicode): text = text.encode('utf-8') for every text parameter. I've moved this RFE to the upstream tracker: https://pagure.io/newt/issue/7 |