axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r397755 - /webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c
Date Fri, 28 Apr 2006 04:36:29 GMT
Author: sahan
Date: Thu Apr 27 21:36:26 2006
New Revision: 397755

URL: http://svn.apache.org/viewcvs?rev=397755&view=rev
Log:
Charset encodings can have  or '' around them

Modified:
    webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c

Modified: webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c?rev=397755&r1=397754&r2=397755&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c Thu Apr 27
21:36:26 2006
@@ -798,6 +798,11 @@
 	tmp2 = strchr(tmp, ';');
 	if(NULL != tmp2)
 	{
+        if('\'' == *(tmp2 - sizeof(axis2_char_t)) ||
+                        '\"' == *(tmp2 - sizeof(axis2_char_t)))
+        {
+           tmp2 -= sizeof(axis2_char_t); 
+        }
 		*tmp2 = '\0';
 	}
 	if(NULL == tmp)
@@ -805,6 +810,21 @@
         AXIS2_FREE((*env)->allocator, tmp_content_type);
 		return AXIS2_STRDUP(AXIS2_HTTP_HEADER_DEFAULT_CHAR_ENCODING, env);
 	}
+    /* Following formats are acceptable
+     * charset="UTF-8"
+     * charser='UTF-8'
+     * charset=UTF-8
+     * But for our requirements charset we get should be UTF-8
+     */
+    if('\'' == *(tmp + sizeof(axis2_char_t)) || '\"' == *(tmp + 
+                        sizeof(axis2_char_t)))
+    {
+       tmp += 2*sizeof(axis2_char_t); 
+    }
+    else
+    {
+        tmp += sizeof(axis2_char_t);
+    }
 	tmp2 =  AXIS2_STRDUP(tmp, env);
 	AXIS2_FREE((*env)->allocator, tmp_content_type);
 	return tmp2;



Mime
View raw message