Ticket #4 (assigned enhancement)

Opened 19 months ago

Last modified 19 months ago

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

openobex-02-iconv-for-unicode-try2.patch (1.8 KB) - added by a_villacis 19 months ago.

Change History

Changed 19 months ago by a_villacis

Changed 19 months 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.

Note: See TracTickets for help on using tickets.