Opened 6 years ago
Last modified 3 years ago
#4 assigned enhancement
OBEX_CharToUnicode does not handle characters outside of US-ASCII correctly
| Reported by: | a_villacis | Owned by: | zany |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | openobex-lib | Version: | |
| Keywords: | Cc: |
Description
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.
Attachments (1)
Change History (2)
Changed 6 years ago by a_villacis
comment:1 Changed 6 years ago by zany
- Owner changed from somebody to zany
- Status changed from new to assigned
- Type changed from defect to enhancement

Please see ticket:1 and add conditionals and automake/autoconf support.