Sunday, February 26, 2012

Browser is failing to render Japanese characters in Data Service response

Problem 

WCF  data services failed to display record for the several languages such as Japanese when used via Devart Data Driver . It renders some junk characters for Japanese values but English is fine, Bellow is the sample
     
 <m:properties>
        <d:CountryCode>JP</d:CountryCode>
        <d:CustomerID>JP-XX</d:CustomerID>
        <d:FullName>¿¿ ¿¿</d:FullName>
   </m:properties>

Root Cause

By default“Dot Connect for Oracle” data driver uses default setting Unicode=False
 http://www.devart.com/dotconnect/universal/docs/UseOraDirect.html  .

I am surprise why, even though it is industry standard?

Solution 
Explicitly Enable Unicode settings in connection string used in webconfig file 

<add name="MyEntities" connectionString="…………provider=Devart.Data.Oracle;provider connection string=&quot;User Id=***;Password=***;Unicode=true;Server=***;Direct=True;Sid=***;Port=***;Persist Security Info=True&quot;" providerName="System.Data.EntityClient" />

No comments:

Post a Comment