Modify

#813 closed defect (fixed)

Oscar module fails to produce outgoing Unicode messages

Reported by: dalias Owned by: Jelmer Vernooij
Priority: normal Milestone:
Component: OSCAR Version: 3.0.3
Keywords: Cc:
IRC client+version: Client-independent Operating System: Linux
OS version/distro:

Description

The oscar module handles character encoding for outgoing messages by first trying to convert the message to Latin-1 (ISO-8859-1) and only attempts to convert to UCS-2 if the first conversion fails. Presumably, the idea is that the first conversion should fail if the message is not faithfully representable in Latin-1, triggering the fallback.

The problem is that the do_iconv function does not treat the inability to represent characters in the target encoding as a failure. do_iconv only fails when iconv_open or iconv returns -1, which would indicate invalid charset, encoding errors in the input string, insufficient space for conversion, etc. - but not failure to represent characters in the destination charset, which is indicated by a positive return value from iconv.

I have attached a patch, but before applying it, some care should be taken to ensure that this doesn't break other code using do_iconv.

Attachments (1)

do_iconv_fix.diff (194 bytes) - added by dalias at 2011-07-02T14:42:29Z.

Download all attachments as: .zip

Change History (2)

Changed at 2011-07-02T14:42:29Z by dalias

Attachment: do_iconv_fix.diff added

comment:1 Changed at 2011-07-02T16:35:31Z by wilmer

Resolution: fixed
Status: newclosed

changeset:devel,800.

Thank you!

Modify Ticket

Action
as closed The owner will remain Jelmer Vernooij.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.