Re: [PATCH] charset
Alexander Malysh <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Paul,
patch looks good except small comments...
comments to this patch:
--- gateway.A9.orig/configure.in        2004-11-06 17:36:55.728060912 +0300
+++ gateway.A9/configure.in        2004-11-06 17:46:21.818002160 +0300
@@ -216,6 +216,18 @@
]
)
+AC_MSG_CHECKING([whether to do all wapbox xml processing in utf-8])
+AC_ARG_ENABLE(scharset,
+[  --enable-scharset                do all wapbox xml processing in utf-8],
+[
+  if test "$enableval" != yes; then
+Â Â Â Â AC_MSG_RESULT(no)
+Â Â else
+Â Â Â Â AC_MSG_RESULT(yes)
+    AC_DEFINE(NEW_CHARSETS, 1, [Simplify wapbox charset processing])
+Â Â fi
+])
why NEW_CHARSET? would it be possible to name this as help message (e.g.
UTF8_CHARSET) because it's just confusing at least me?
--- gateway.A9.orig/gw/wap-appl.c        2004-11-06 17:41:37.645202992 +0300
+++ gateway.A9/gw/wap-appl.c        2004-11-06 17:46:21.819002008 +0300
...
@@Â -1055,11Â +1060,29Â @@
            Â
             /* get charset used in content body, default to utf-8 if not present */
             if ((charset = find_charset_encoding(content.body)) == NULL)
+#ifdef NEW_CHARSETS
+                if (octstr_len(content.charset) > 0) {
+                    charset = octstr_duplicate(content.charset);
^^^^ possible memleak
+                } else {
+                    charset = octstr_imm("UTF-8");
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â }
+#else
                 charset = octstr_imm("UTF-8");Â
+#endif
Please either octstr_imm(...) or octstr_create(...)..
Paul P Komkoff Jr wrote:
> attached
--
Thanks,
Alex