After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 606022 - Special characters within titles prevent clickable links
Special characters within titles prevent clickable links
Status: RESOLVED FIXED
Product: gnote
Classification: Applications
Component: main
0.7.x
Other Linux
: Normal normal
: ---
Assigned To: gnote-maint
gnote-maint
: 616120 630704 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-01-04 14:48 UTC by Benoît Zugmeyer
Modified: 2010-09-27 20:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix for the bug. (4.28 KB, patch)
2010-03-12 19:24 UTC, Aurimas Černius
committed Details | Review

Description Benoît Zugmeyer 2010-01-04 14:48:57 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.
Comment 1 Benoît Zugmeyer 2010-01-04 15:16:50 UTC
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.
Comment 2 Aurimas Černius 2010-01-12 21:22:41 UTC
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.
Comment 3 Aurimas Černius 2010-03-12 19:24:45 UTC
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.
Comment 4 Benoît Zugmeyer 2010-03-12 20:13:29 UTC
Good work ! thanks a lot.
I hope this fix will be in the main release soon...
Comment 5 Debarshi Ray 2010-03-15 01:29:39 UTC
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.
Comment 6 Debarshi Ray 2010-03-15 01:47:33 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.
Comment 7 Aurimas Černius 2010-09-03 20:47:07 UTC
*** Bug 616120 has been marked as a duplicate of this bug. ***
Comment 8 Aurimas Černius 2010-09-27 20:23:45 UTC
*** Bug 630704 has been marked as a duplicate of this bug. ***