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".

Hi Michael,

Until one month ago, linux usb subsystem have gotten the device name, translated it from utf-16 to latin-1 and give device names as latin-1 to applications.

The http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a853a3d4eb2edb066248a39f0634f6f5858816a0 commit changes that, so starting with 2.6.31 my ekiga patch should be removed (or make #ifdef linuxversion <= 2.6.30...)

In the original ubuntu bug report, someone with such a camera and under windows had no problem. In fact, I was told that windows gives device names already in utf-8.

If I understand you correctly, this is not the case for you?!

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).

In linux, it's the same to my knowledge.

I think that in ekiga storing in locale in gconf entries was a very old code, which should now be removed, is that right (your third patch)?

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.

ekiga02_devstring.diff involves quite a few files. It does the device string conversions summarized above.

ekiga03_isutf8.diff cleans up ekiga/lib/gui/gmpreferences.c. Linux is completely UTF-8 and for Win32 we have done the conversion to UTF-8 with the second patch earlier. Moreover double conversion to UTF-8 does not work when there are any special characters.

In some parts the patches seem a bit bulky. Do you have any idea how to solve the device string issue for Win32 in a more elegant way?



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