OBEX_CharToUnicode does not handle characters outside of US-ASCII correctly
|Reported by:||a_villacis||Owned by:||zany|
This patch replaces the OBEX_CharToUnicode implementation with a more functional version which uses iconv for charset conversion. The previous implementation is not useful for non-English locales, because it "converts" characters to Unicode by tacking a null byte to form a 16-bit big-endian value. My phone has an images directory called "Imágenes" (that is, a string with U+00E1 LATIN SMALL LETTER A WITH ACUTE). In my case, I was lucky because the low byte of the codepoint happens to match the same symbol in the ISO-8859-1, so some trickery with the iconv command-line tool was enough. Now imagine somebody in Japan with a directory name written in Kanji...
Original patch had only one fallback to iso-8859-1. This patch (modified by colimit@…) tries to use the system locale to convert characters, and is supposed to work on all locales, not just UTF-8.