1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000274 [FreeCAD] Bug minor always 2011-02-20 16:55 2011-02-21 12:11
Reporter wmayer View Status public  
Assigned To wmayer
Priority normal Resolution fixed  
Status closed   Product 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é"
Additional Information
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0000625)
wmayer (administrator)
2011-02-20 16:56

Reminder sent to: yorikvanhavre

Added a bug report due to the printing issue
(0000626)
wmayer (administrator)
2011-02-21 12:11

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.

- Issue History
Date Modified Username Field Change
2011-02-20 16:55 wmayer New Issue
2011-02-20 16:55 wmayer Status new => assigned
2011-02-20 16:55 wmayer Assigned To => wmayer
2011-02-20 16:56 wmayer Issue Monitored: yorikvanhavre
2011-02-20 16:56 wmayer Note Added: 0000625
2011-02-21 12:11 wmayer Note Added: 0000626
2011-02-21 12:11 wmayer Status assigned => closed
2011-02-21 12:11 wmayer Resolution open => fixed
2011-02-21 12:11 wmayer Fixed in Version => 0.11


Mantis 1.1.8[^]
Copyright © 2000 - 2009 Mantis Group
Powered by Mantis Bugtracker