Skip to main content
Participant
December 13, 2011
Question

Unable to display Unicode characters

  • December 13, 2011
  • 1 reply
  • 827 views

I am receving contents in japnese language from server , and i am unable to display unicode characters.


cfm code:

<cfhttp

          method="post"

          url=" http://localhost/sampleWeb/readLetter.do"

          resolveurl="Yes"

           charset = "utf-8">

          <cfhttpparam type="header" name="accept-encoding" value="deflate;q=0">

          <cfhttpparam name="docID" type="FormField" value="595">

</cfhttp>

     <cfset source="#cfhttp.fileContent#">

  <cfprocessingdirective suppressWhiteSpace = "yes" pageEncoding = "utf-8">

<cfoutput>

          #html_src#

</cfoutput>

 

</cfprocessingdirective>

   

<cffile action = "write"

    file = "\\cahywr1bigsya03\wwwroot$\cadd_dev\v2\1.html"

              output = "#html_src#">

<cfoutput>

          #html_src#

</cfoutput>

i have also logged the contents in an html file at server before sending to client. This file when viewed in browser shows japanese characters properly but at client, the received characters does not show japanese instead i get some invalid characters(might be extended ASCII characters)


Browser encoding set to Unicode (utf-8)

please suggest how to receive unicode characters from server and display at client browser...

server side code:



response.setContentType("text/html");


response.setHeader("cache-Control","no-cache");




response.setCharacterEncoding("utf-8");


response.setContentType("text/html"); 




response.getOutputStream().write(buffer.toString().getBytes("utf-8"));


response.getOutputStream().flush();


response.getOutputStream().close();


    This topic has been closed for replies.

    1 reply

    Participant
    May 7, 2013

    hi Harish,

        I meet the same problem. Did you solve this problem? Thank you.