[Tracker] [Patch] Correct locales support



Hello,

in my tests I saw some issues with locales support in clients. For
instance if I search something I can see something like

/home/laurent/Musique/T?t?

instead of

/home/laurent/Musique/TÃtÃ


It seems that g_print() tries to be smart about locales handling but
needs a sort of initialization before.
To test I called g_get_charset() that replied ANSI_X3.4-1968 (it is
ASCII) instead of UTF-8...

setlocale(LC_ALL, "")  does this initialization and set LC_ALL to a
value from user environment (see manpages).


So I added calls to setlocal() in all clients. Currently 'tracker-stats'
doesn't need that since it only prints in-ASCII infos but I prefer to
prevent a day where more stats/something will be added and a bug will be
found about locales...

My patch also adds some forgotten '#include' or removes unnecessary
ones.


I also provide a second patch. The first patch targets clients while the
second is only for trackerd. It adds a call to setlocal() too. So
trackerd doesn't print invalid strings in STDOUT. I don't know if other
Glib functions act differently with correctly set locales...
Surprisingly 'tracker.log' is always correct *BUT* now dates are written
accordingly to locales so for me it is in french: '27 aoà 2006' instead
of '27 aug 2006'... Is it really a problem? Could we use day/month/year
format which is almost international?

This format comes from:
 strftime (buffer, 64, "%d %b %Y, %H:%M:%S:", loctime);
in tracker-utils.c.



Laurent.

Attachment: correct-locales-support-in-clients.diff
Description: Text Data

Attachment: correct-locales-support-in-trackerd.diff
Description: Text Data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]