modified sms converting flow for umlaut characters
authorsungmin ha <sungmin82.ha@samsung.com>
Wed, 5 Sep 2012 08:29:52 +0000 (17:29 +0900)
committersungmin ha <sungmin82.ha@samsung.com>
Wed, 5 Sep 2012 08:29:52 +0000 (17:29 +0900)
debian/changelog
debian/control
lib/libsms/sms_tool.c
packaging/vmodemd-emul.spec

index 6451376..6100ed0 100644 (file)
@@ -1,3 +1,11 @@
+vmodemd-emul (0.2.19) unstable; urgency=low
+
+  * modified sms converting flow for umlaut characters
+  * Git: slp/pkgs/v/vmodem-daemon-emulator
+  * Tag: vmodemd-emul_0.2.19
+
+ -- Sungmin Ha <sungmin82.ha@samsung.com> Wed, 05 Sep 2012 17:24:53 +0900
+
 vmodemd-emul (0.2.18) unstable; urgency=low
 
   * modified operation of CHLD=0 for applying spec
index 76d55a0..6d18119 100644 (file)
@@ -3,7 +3,7 @@ Section: devel
 Priority: extra
 Maintainer: SungMin Ha <sungmin82.ha@samsung.com>,Jihye Kim <jihye1128.kim@samsung.com>,Yeongkyoon Lee <yeongkyoon.lee@samsung.com>
 Build-Depends: bison, flex, autoconf, gcc, debhelper, libglib2.0-dev, libxml2-dev, libvconf-dev
-Standards-Version: 0.2.18
+Standards-Version: 0.2.19
 
 Package: vmodemd-emul
 Architecture: i386
index e21bfae..9155388 100644 (file)
@@ -178,19 +178,40 @@ int MsgConvertGSM7bitToUCS2(unsigned char *pDestText, int maxLength, const unsig
                        fprintf(stderr, ">>>>>>>a_pTextString[i]=%x, The alpha isn't the gsm 7bit code, Never Come here!!!\n", pSrcText[i]);
                        return -1;
                }
+
+               unsigned char utf8Buf[2], ucs2Buf[4];
                if(g_GSM7BitToUCS2Table[ pSrcText[i] ] == 0x0/*0*/)
                {       //extended gsm7bit
+                       fprintf(stderr, "extended gsm7bit!\n");
                        i++;
-                       lowerByte = g_GSM7BitToUCS2TableExt[ pSrcText[i] ] & 0x00FF;
-                       upperByte = (g_GSM7BitToUCS2TableExt[ pSrcText[i] ] & 0xFF00) >> 8;
+                       ucs2Buf[0] = (g_GSM7BitToUCS2TableExt[ pSrcText[i] ] & 0xFF00) >> 8;
+                       ucs2Buf[1] = g_GSM7BitToUCS2TableExt[ pSrcText[i] ] & 0x00FF;
+                       MsgConvertUCS2toUTF8(&utf8Buf, 256, ucs2Buf, 2);
+                       pDestText[outTextLen++] = utf8Buf[0];
                }
                else
                {
                        lowerByte = g_GSM7BitToUCS2Table[ pSrcText[i] ] & 0x00FF;
                        upperByte = (g_GSM7BitToUCS2Table[ pSrcText[i] ] & 0xFF00) >> 8;
+               
+                       if(upperByte != 0x00)
+                       {
+                               fprintf(stderr, "upperByte is not 0x00\n");
+                               ucs2Buf[0] = upperByte;
+                               ucs2Buf[1] = lowerByte;
+                               MsgConvertUCS2toUTF8(&utf8Buf, 256, ucs2Buf, 2);
+                               pDestText[outTextLen++] = utf8Buf[0];
+                               pDestText[outTextLen++] = utf8Buf[1];
+                               fprintf(stderr,"upperByte:%x, lowerByte:%x\n", upperByte, lowerByte);
+                       }
+                       else
+                       {
+                               pDestText[outTextLen++] = lowerByte;
+                               fprintf(stderr,"lowerByte:%x\n", lowerByte);
+                       }
                }
-               pDestText[outTextLen++] = upperByte;
-               pDestText[outTextLen++] = lowerByte;
+               //pDestText[outTextLen++] = upperByte;
+               //pDestText[outTextLen++] = lowerByte;
                maxLength -= 2;
        }
 
@@ -500,9 +521,11 @@ int MsgConvertGSM7bitToUTF8(unsigned char *pDestText, int maxLength,  const unsi
        fprintf(stderr, "max dest Length = %d\n", maxLength);
 
        ucs2Length = MsgConvertGSM7bitToUCS2((unsigned char*)pUCS2Text, maxUCS2Length * sizeof(unsigned short), pSrcText,  srcTextLen);
-       utf8Length = MsgConvertUCS2toUTF8(pDestText, maxLength, (unsigned char*)pUCS2Text, ucs2Length);
+       memcpy(pDestText, pUCS2Text, ucs2Length);
+       //utf8Length = MsgConvertUCS2toUTF8(pDestText, maxLength, (unsigned char*)pUCS2Text, ucs2Length);
 
-       return utf8Length;
+       //return utf8Length;
+       return ucs2Length;
 }
 
 
index 4a5acd7..8c974f7 100644 (file)
@@ -1,6 +1,6 @@
 #git:slp/pkgs/v/vmodem-daemon-emulator
 Name: vmodemd-emul
-Version: 0.2.18
+Version: 0.2.19
 Release: 1
 Summary: Modem Emulator
 Group: System/ModemEmulator