Re: [Ekiga-devel-list] Win32 UTF-8 vs. Codepage or what so ever



Michael Rickmann wrote:
Ekiga's handling of Windows file names and device names is done mostly in UTF-8 which works as long as there are no national characters in the names. I have a German Windows and a USB headset which in Ekiga shows up as "USB-Ger" instead of "USB-Gerät" (USB device). Ok, I can click Ekiga's update devices and then there is a "USB-Gerät" which I can select thanks to the g_locale_to_utf8 support in ekiga/lib/gui/gmpreferences.c. However, the next time Ekiga is started it complains because it is unable to open the "USB-Ger".

I tried a similar approach as Eugen did when fixing bug #575907 (git c9aedde44825, 2009-04-21). But similar changes at the level of lib/components/ptlib device managers using g_locale_to_utf8 and back would not work for Windows. Presumably some library calls have been in between. For Win32 Ekiga the separation of (UTF-8) vs. (Codepage) with respect to Ptlib's device names is
(GUI + gconf) vs. (C-library + device strings).
A good place to convert the device strings to UTF-8 is gm_prefs_window_convert_string_list in ekiga/src/gui/preferences.cpp. Conversion from UTF-8 can only be done where we know that it is a device string, i. e. in the device gmconf-bridges. I have prepared three patches and tested them under Windows and for adverse effects also Linux.

ekiga01_filename.diff is not so important but easy. It allows special characters in the sound files. It shows the principle of converting from UTF-8, i.e having a specialized routine in lib/gmconf/gmconf-glib.c which is called for WIN32 from audiooutput-gmconf-bridge.cpp.

I think that instead of a macros such as:
-    c_file_name = gm_conf_get_string (SOUND_EVENTS_KEY "busy_tone_sound");
+ c_file_name = GM_CONF_GET_FILE_NAME (SOUND_EVENTS_KEY "busy_tone_sound");

better use something like this:
 c_file_name = gm_conf_get_string (SOUND_EVENTS_KEY "busy_tone_sound");
+ #ifdef WIN32
+ c_file_name = utf_to_locale (c_file_name);
+ #endif

What do you think?

--
Eugen


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