gnokii-users
[Top][All Lists]
Advanced

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

gnokii Unicode support bug


From: James Clark
Subject: gnokii Unicode support bug
Date: Wed, 19 Feb 2003 19:22:12 +0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20030211

I'm using a gnokii 0.5.0pre8 with a Nokia 8890 (using the AT model) on Redhat Linux 8.0 via Bluetooth. I'm using a UTF-8 locale (i.e. I have LANG=en_US.UTF-8). I have some phonebook names in Thai. Each Thai character when encoded in UTF-8 takes 3 bytes. This causes a problem in atgen.c which assumes that char_ucs2_decode will produce exactly 1 byte for each Unicode char. The sympton is that the names get truncated and illegal UTF-8 is output. Attached is a patch.

James
--- common/phones/atgen.c~      2003-02-19 07:31:35.000000000 +0700
+++ common/phones/atgen.c       2003-02-19 18:41:27.000000000 +0700
@@ -796,7 +796,6 @@
                                break;
                        case AT_CHAR_UCS2:
                                char_ucs2_decode(data->phonebook_entry->name, 
pos, l);
-                               *(data->phonebook_entry->name + (l / 4)) = '\0';
                                break;
                        default:
                                memcpy(data->phonebook_entry->name, pos, l);
--- common/gsm-encoding.c~      2003-02-19 07:31:33.000000000 +0700
+++ common/gsm-encoding.c       2003-02-19 18:41:54.000000000 +0700
@@ -364,6 +364,7 @@
                        break;
                }
        }
+       dest[o_len] = '\0';
        return;
 }
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]