You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rj...@apache.org on 2012/11/27 13:50:37 UTC

svn commit: r1414161 - /httpd/mod_mbox/trunk/module-2.0/mod_mbox_cte.c

Author: rjung
Date: Tue Nov 27 12:50:36 2012
New Revision: 1414161

URL: http://svn.apache.org/viewvc?rev=1414161&view=rev
Log:
Error log shows that conversion from "utf8" to
"utf-8" is a common unhandled case, at least on
FreeBSD (there seems to be no alias for "utf8").

Implement it as a copy operation.

Modified:
    httpd/mod_mbox/trunk/module-2.0/mod_mbox_cte.c

Modified: httpd/mod_mbox/trunk/module-2.0/mod_mbox_cte.c
URL: http://svn.apache.org/viewvc/httpd/mod_mbox/trunk/module-2.0/mod_mbox_cte.c?rev=1414161&r1=1414160&r2=1414161&view=diff
==============================================================================
--- httpd/mod_mbox/trunk/module-2.0/mod_mbox_cte.c (original)
+++ httpd/mod_mbox/trunk/module-2.0/mod_mbox_cte.c Tue Nov 27 12:50:36 2012
@@ -256,6 +256,13 @@ apr_status_t mbox_cte_convert_to_utf8(ap
     char *dst;
     if (len <= 0)
         return APR_SUCCESS;
+    /* Special case "utf8": it is often unknown (no alias) */
+    if (!strcmp(charset, "utf8")) {
+        ap_log_error(APLOG_MARK, APLOG_TRACE7, 0, ap_server_conf,
+                     "Shortcut for convset 'utf8'");
+        ap_varbuf_strmemcat(vb, src, len);
+        return APR_SUCCESS;
+    }
     rv = apr_xlate_open(&convset, "UTF-8", charset, p);
     if (rv != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_ERR, rv, ap_server_conf,



Re: svn commit: r1414161 - /httpd/mod_mbox/trunk/module-2.0/mod_mbox_cte.c

Posted by Rainer Jung <ra...@kippdata.de>.
On 27.11.2012 14:51, Nick Kew wrote:
> On Tue, 27 Nov 2012 12:50:37 -0000
> rjung@apache.org wrote:
> 
> 
>> +    /* Special case "utf8": it is often unknown (no alias) */
>> +    if (!strcmp(charset, "utf8")) {
> 
> charset was uppercased just before this (at least when called from
> within this source file), so a comparison to a lowercase string isn't
> useful!

There are two calls to this method, the other one comes from a different
file. That's the one that was frequently logged in the error log of the
ASF mail-archives server. The upper case version didn't show up there.
For consistency and because that might depend on the platform I now
included checks against both versions. I refrained from using
strcasecmp() because I don't expect mixed case here.

Regards,

Rainer


Re: svn commit: r1414161 - /httpd/mod_mbox/trunk/module-2.0/mod_mbox_cte.c

Posted by Nick Kew <ni...@webthing.com>.
On Tue, 27 Nov 2012 12:50:37 -0000
rjung@apache.org wrote:


> +    /* Special case "utf8": it is often unknown (no alias) */
> +    if (!strcmp(charset, "utf8")) {

charset was uppercased just before this (at least when called from
within this source file), so a comparison to a lowercase string isn't
useful!


-- 
Nick Kew