Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • jivan thapa 194 posts 681 karma points
    Dec 23, 2011 @ 11:33
    jivan thapa
    0

    non english character does not display correctly If I use Mysql Database

    Umbraco verson 4.7.1

    I have one umbraco site that uses MySql Database. Problem is that it does not display correctly Nepalese characters.

    For example I have this character " " it displays correctly in RichText Editor. After I published the content It shows ?????????????????????????????????????????????????????????????????????????????? in webpage. but it displays correctly in RichText Editor.

    I also checked Tidy is set to Utf8.

    <TidyEditorContent>True</TidyEditorContent>
    
    <TidyCharEncoding>UTF8</TidyCharEncoding>
    

    I have also another website that uses MSSQL Database. it works perfectly on that website. Problem is if i use MySql Database.

    Here is XSLT

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet 
      version="1.0" 
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
      xmlns:msxml="urn:schemas-microsoft-com:xslt"
      xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" 
      exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">
    <xsl:output method="xml" omit-xml-declaration="yes"/>
    <xsl:param name="currentPage"/>
    <xsl:template match="/">
    <!-- start writing XSLT -->
     <div class="sub-content-wrapper">
       <div class="content_border"
         <h3>  <xsl:value-of select="$currentPage/contentTitle"/></h3
       </div>   
          <xsl:if test="string-length($currentPage/contentImage)&gt;1">
            <img src="{$currentPage/contentImage}" width="600px"/>
          </xsl:if>  
      <div>     
         <xsl:value-of select="$currentPage/contentBody" disable-output-escaping="yes"/>    
       </div>   
       </div>
    </xsl:template>
    </xsl:stylesheet>
    

    Any suggestions?

    thanks

    Jivan

     

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Dec 23, 2011 @ 12:45
    Jan Skovgaard
    0

    Hi Jivan

    I think it has to do with the character set i MySQL. It's related to MySQL not Umbraco itself I think. It seems like it maybe has to do with the tables being created with a character set based on latin1 instead of utf8.

    You can read more about it here: http://alexking.org/blog/2008/03/06/mysql-latin1-utf8-conversion and here http://www.bluebox.net/news/2009/07/mysql_encoding

    I hope this helps.

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft