• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Coldfusion 10 return a ISO-8859-1 string from a restful web service?

Guest
May 05, 2014 May 05, 2014

Copy link to clipboard

Copied

Hi All,

Is there anyway for a Restful web service function to return a "ISO-8859-1"  charset string instead of an UTF-8 charset?

I have tried this in my function but it isn't working.

<cfcomponent rest="true" restPath="/TestString">

        <cffunction name="TheTestString" access="remote" returnType="String" httpMethod="GET">

                 <cfset res="Hey guys, I hope you like #trim(TheTestString)#">

         <cfset TempString = CharsetDecode(res,"ISO-8859-1")>

        <cfset ReturnString  = CharsetEncode(TempString ,"ISO-8859-1")>

                 <cfreturn ReturnString >

        </cffunction>

</cfcomponent>

Any ideas?

Thanks!

Views

148

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation
Resources
Documentation