tracker issue : CF-3618494

select a category, or use search below
(searches all categories and all time range)
Title:

ColdFusion 10 Rest API mangles international characters in the request

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/NotABug

Reporter/Name(from Bugbase): Johnny O / Johnny O (Johnny O)

Created: 08/26/2013

Components: REST Services

Versions: 10.0

Failure Type: Data Corruption

Found In Build/Fixed In Build: Final /

Priority/Frequency: Critical / All users will encounter

Locale/System: English / Windows 7 SP1 64-bit

Vote Count: 1

Problem Description:

ColdFusion 10's new Rest API mangles international characters in the request.  For example, a request that looks like this:

PUT http://www.bcjobs.local/rest/v1.0/widgets HTTP/1.1
User-Agent: Fiddler
Host: www.bcjobs.local
Content-Length: 15

?????

Turns ????? to ã?“ã‚“ã?«ã?¡ã?¯on the server.

Steps to Reproduce:

Create a rest endpoint like this:

<cfcomponent rest="true" restpath="/widgets" produces="application/json">

    <cffunction name="echo" access="remote" httpmethod="PUT" returntype="string">       
        <cfreturn GetHttpRequestData().content />
    </cffunction>

</cfcomponent>

Make a request like this:

PUT http://www.bcjobs.local/rest/v1.0/widgets HTTP/1.1
User-Agent: Fiddler
Host: www.bcjobs.local
Content-Length: 15

?????


Actual Result:

HTTP/1.1 200 OK
Content-Type: application/json
Server: Microsoft-IIS/7.5
Date: Mon, 26 Aug 2013 23:59:09 GMT
Content-Length: 37

ã?“ã‚“ã?«ã?¡ã?¯


Expected Result:

HTTP/1.1 200 OK
Content-Type: application/json
Server: Microsoft-IIS/7.5
Date: Mon, 26 Aug 2013 23:59:09 GMT
Content-Length: 15

?????


Any Workarounds:

Can't think of any.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3618494

Deployment Phase:	Release Candidate

External Customer Info:
External Company:  
External Customer Name: JohnnyO5
External Customer Email:  
External Test Config: My Hardware and Environment details:



Windows 7 or 2008, IIS, ColdFusion 10

Attachments:

Comments:

I also asked about a workaround here: http://stackoverflow.com/questions/18454977/coldfusion-10-rest-api-utf-8-characters
Comment by External U.
14621 | August 26, 2013 06:46:11 PM GMT
This is exactly the behavior that I was seeing when developing Taffy and decided to force UTF-8. As I posted in the Stack Overflow thread linked by the OP, here's the code I used: <cffunction name="getRequestBody" access="private" output="false" hint="Gets request body data, which CF doesn't do automatically for some verbs"> <cfset var body = getHTTPRequestData().content /> <cfif isBinary(body)> <cfset body = charsetEncode(body, "UTF-8") /> </cfif> <cfreturn body /> </cffunction> I agree that this is a bug, but the above code should be a sufficient work-around in the meantime.
Comment by External U.
14622 | August 27, 2013 03:26:17 PM GMT
+1. All data-transfer ops in CF should respect UTF-8 without too much messing around. -- Adam
Vote by External U.
14624 | October 01, 2013 09:43:26 AM GMT
httparam with these properties set has to be passed. <cfhttpparam type="header" name="Content-Type" value="text/plain; charset=UTF-8"> There was a bug for charset encoding was not handled correctly(#CF-3342142) which got fixed in update 11. Please verify this bug #CF-3618494, with update 11 or later.
Comment by HariKrishna K.
14623 | January 27, 2014 06:45:56 AM GMT