x First time here? Check out the FAQ

Come work for Umbraco - The Umbraco HQ are hiring Project managers, .NET developers and DevOps people!

  • Avatar87posts177karma

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

    jivan thapa started this topic December 23, 2011 @ 11:33

    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 posted this reply December 23, 2011 @ 12:45

    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 login or Sign up To post replies