View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000274 | FreeCAD | Bug | public | 2011-02-20 15:55 | 2011-02-21 11:11 |
Reporter | wmayer | Assigned To | wmayer | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 0.11 | ||||
Target Version | 0.11 | Fixed in Version | 0.11 | ||
Summary | 0000274: Localization problem with console and UTF-8 strings | ||||
Description | See: http://sourceforge.net/apps/phpbb/free-cad/viewtopic.php?f=10&t=790&start=70 App.Console.PrintMessage("test") prints "test" App.Console.PrintMessage("testé") prints "testé" App.Console.PrintMessage(u "testé") prints "testé" App.Console.PrintMessage(u"testé".encode("utf8")) prints "testé" App.Console.PrintMessage(u"testé".encode("latin1")) prints "testé" | ||||
Tags | No tags attached. | ||||
FreeCAD Information | |||||
|
Reminder sent to: yorik Added a bug report due to the printing issue |
|
We now always encode the input string as latin1 which (probably) the best trade-off in most cases. Now it gives these results: App.Console.PrintMessage("test") prints "test" App.Console.PrintMessage("testé") prints "testé" App.Console.PrintMessage(u"testé") prints "testé" App.Console.PrintMessage(u"testé".encode("utf8")) prints "testé" App.Console.PrintMessage(u"testé".encode("latin1")) prints "testé" But it always depends on how the input is actually encoded. As you can see App.Console.PrintMessage(u"testé".encode("utf8")) prints "testé" is still not what you expect. But u"testé".encode("utf8") returns a str object nota unicode object and FreeCAD encodes this again as UTF-8. So, it's actually in the responsibility of the caller/user to do that right. |
Date Modified | Username | Field | Change |
---|---|---|---|
2011-02-20 15:55 | wmayer | New Issue | |
2011-02-20 15:55 | wmayer | Status | new => assigned |
2011-02-20 15:55 | wmayer | Assigned To | => wmayer |
2011-02-20 15:56 | wmayer | Note Added: 0000625 | |
2011-02-21 11:11 | wmayer | Note Added: 0000626 | |
2011-02-21 11:11 | wmayer | Status | assigned => closed |
2011-02-21 11:11 | wmayer | Resolution | open => fixed |
2011-02-21 11:11 | wmayer | Fixed in Version | => 0.11 |