[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [TSVN] TortoiseSVN codepage considerations

From: SteveKing <steveking_at_gmx.ch>
Date: 2005-05-18 21:58:22 CEST

Norbert Unterberg wrote:
> I wonder what TortoiseProc currently does with the thread locale. It
> sets the locale to 1033 (english u.s.) at the beginning of InitInstance,
> but then sets it again when it finds a matching language resource DLL,
> correct?

If we don't set the thread locale, then the Subversion messages won't
show up correctly. Subversion uses gettext, and gettext determines which
translated strings to use depending on the locale set.
So, we set the locale to english first because that's TSVN's and
Subversion's default language. If no language dll is selected, then
that's the locale which is used, and Subversions messages (mostly error
messages) are returned in english, even if there are other languages
installed for Subversion/TSVN. If however a language dll is selected,
then we set the locale accordingly, so that the Subversion strings will
be returned according to the selected language too.

> The problem with this is that the current thread locale might not only
> select the language (when using multi-language resources). It also
> dictates the code page used for the CStringA/CStringW conversion which
> is frequently used in the application. Was that intentional? If not, how
> about not setting the thread locale at all? In addition, you might
> concider to call at least setlocale(LC_CTYPE, "") there, to set the
> runtime library to the correct encoding. I think setting the thread
> locale was the inital cause for blame to fail on asian languages,
> because this caused asian multibyte characters to be falsly interpreted
> in the western ansi code page.

It will only fail if they run TSVN in english (or another non-native
language). If they set the correct language in the settings, it would
have worked. (And it also was reported that it works then).

> I do not dare to create a patch changing this because the locale might
> affect some other library and windows API functions, and do not know if
> you rely on a specific code page and the default C locale at other
> places throughout the code.

If you have an idea on how to force gettext to use a specific language
and not the one set by the thread locale, we could get rid of that...

Stefan

-- 
       ___
  oo  // \\      "De Chelonian Mobile"
 (_,\/ \_/ \     TortoiseSVN
   \ \_/_\_/>    The coolest Interface to (Sub)Version Control
   /_/   \_\     http://tortoisesvn.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Wed May 18 21:58:41 2005

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.