GNOME Bugzilla – Bug 606022
Special characters within titles prevent clickable links
Last modified: 2010-09-27 20:23:45 UTC
How to reproduce : - Create a new note - Write " Bonne année ! " - Select it and make a new note - The note is created with the right title, but the link in the first note does not appears. You can try with any accentuated character, or the ° sign... I tried on gnote 0.7.0, ArchLinux i686 distribution, under KDE 4.3. (please do not tell me to switch to gnome !) I can add informations if you need.
Additionally, there is strange behaviors when you want to add links directly after a (non working) link containing special characters. Most of the time, they do not work.
This problem might be because char is used as character data type. Special characters, like ąčęėįšųūž are 2 bytes, while char is 1, so in trie.hpp line 147 (add_keyword()) all special characters are processed as 2 characters. Also, in line 157, the ::tolower() doesn't lowercase special characters. One possible solution is to replace std::string to std::wstring and char to wchar_t. Other is to use Glib unicode functions.
Created attachment 156006 [details] [review] Fix for the bug. Links are not created because trie finds matches using offsets in bytes, not characters. When note contains multibyte unicode characters, offsets in bytes and characters are not the same. In most cases links are not created, because check for full words fail. Bug 610406 also needs to be applied for this fix to work.
Good work ! thanks a lot. I hope this fix will be in the main release soon...
Review of attachment 156006 [details] [review]: Good catch. Instead of converting the std::string to Glib::ustring within the methods, lets just change the parameter to be Glib::ustring. Keeps things simple.
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.
*** Bug 616120 has been marked as a duplicate of this bug. ***
*** Bug 630704 has been marked as a duplicate of this bug. ***