[RFC] wml->wmlc default character mangling
Stipe Tolj <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Organization | The Kannel Group |
| Message-ID | <[email protected]> |
Hi list, ok, following the thread frrom Rune Saetre [Msg-Id: <[email protected]>] I come up with following status-quo conclusion while reviewing the code: (HEAD in CVS): * entering gw/wap-appl.c:return_reply() we receive the HTTP response (headers and body) * if status was OK (HTTP 200) we perform some character convert to utf-8 for various content-types, see line 842. * in fact we check via find_charset_encoding() if there has been an encoding in the XML preamble. Hence in the body of the response. If there is not, we assume utf-8 as character encoding. (BTW, no implication from the content-type HTTP header yet). * if XML preamble gives a non-utf-8 encoding, but the device indicates that it supports utf-8, we do convert, line 866. * we do the same as a "backup" for iso-8859-1 in case utf-8 is not supported by the device. * then we run into the conver_content() routine that does the lookup in the converter array, bringing us up to convert_wml_to_wmlc() and hence to wml_compile(). * so far so good * wml_compile() seems to do the mangling "once again" ?! * gw/wml_compiler.c:351: if passed charset var is not utf-8 then call gw/xml_shared.c:set_charset(), which converts to utf-8. * now we obey the rules: first: pick XML preamble encoding value, second: pick given HTTP header value, third: fallback to utf-8. * and we come up to the libxml2 parsing calls. ok, so where are the things in here to be changed (from policy site of view) if any? Stipe mailto:stolj_{at}_wapme.de ------------------------------------------------------------------- Wapme Systems AG Vogelsanger Weg 80 40470 Düsseldorf, NRW, Germany phone: +49.211.74845.0 fax: +49.211.74845.299 mailto:info_{at}_wapme-systems.de http://www.wapme-systems.de/ -------------------------------------------------------------------