1. #1
    Ext JS Premium Member
    Join Date
    Jun 2009
    Posts
    29
    Vote Rating
    0
    tombal93 is on a distinguished road

      0  

    Default htmlDecode and japanese

    htmlDecode and japanese


    Hello,

    I have a Window with a jsonreader to display data in french, english and japanese from a firebird database

    Code:
    reader : new Ext.data.JsonReader({           
                        fields: [
                            {name: 'RUBRIQUE_FR', type:'string'},
                            {name: 'RUBRIQUE_AN', type: 'string'},
                            {name: 'RUBRIQUE_JP', type: 'string', convert: function(v){return Ext.util.Format.htmlDecode(v);}},
    
                        ]
                    }),
    I insert data in Firebird database from an extjs window with PHP. In my database japanese data are in HTML and in my reader i'm using a convert function (htmlDecode) but it seems that htmldecode didn't convert this HTML into japanese character.

    When i use in php :

    PHP Code:
    echo html_entity_decode('サイエンス'); 
    I have correct japanese but not with Extjs htmlDecode

    I'm using Ext Designer and should i put my *.js into PHP file with setValue instead of Jsonreader with convert ?

    Thanks for your help

    Tom

  2. #2
    Ext JS Premium Member
    Join Date
    Jun 2009
    Posts
    29
    Vote Rating
    0
    tombal93 is on a distinguished road

      0  

    Default


    I found the solution for my problem.

    I was looking for a solution on the client-side using convert function in my jsonreader but the solution was server-side.

    I add data in the database with an insert query using

    PHP Code:
    $larequete "insert into sous_rubriques (id_sous_rubrique, sous_rubrique_fr, sous_rubrique_an, sous_rubrique_jp, id_rubrique) values (".$lid.", '".utf8_decode($_POST['SOUS_RUBRIQUE_FR'])."', '".utf8_decode($_POST['SOUS_RUBRIQUE_AN'])."', '".mb_convert_encoding($_POST['SOUS_RUBRIQUE_JP'], 'HTML-ENTITIES','UTF-8')."', ".$_POST['lidrub'].")"
    and after i use in my php that generate my json for my jsonreader

    PHP Code:
    $query "select sr.id_sous_rubrique, sr.sous_rubrique_fr, sr.sous_rubrique_an, sr.sous_rubrique_jp, r.rubrique_fr, sr.id_rubrique from sous_rubriques sr join rubriques r on r.id_rubrique=sr.id_rubrique where sr.id_sous_rubrique=".$_POST['id_sous_rubrique'];
       
    $statement ibase_query($conn$query) or die(ibase_errmsg());
       
          
        while (
    $row ibase_fetch_object($statement)) {
        
    $rec['SOUS_RUBRIQUE_FR'] = utf8_encode($row->SOUS_RUBRIQUE_FR);
        
    $rec['SOUS_RUBRIQUE_AN'] = utf8_encode($row->SOUS_RUBRIQUE_AN);
        
    $rec['SOUS_RUBRIQUE_JP'] = mb_convert_encoding($row->SOUS_RUBRIQUE_JP'UTF-8','HTML-ENTITIES');
        
    $rec['RUBRIQUE_FR'] = utf8_encode($row->RUBRIQUE_FR);
        
    $rec['ID_RUBRIQUE'] = $row->ID_RUBRIQUE;
        
    $arr[] = $rec;
        }
        
        
    $jsonresult json_encode($arr);
        echo 
    $jsonresult

Similar Threads

  1. MaskRE for DoubleByte Characters (Japanese, Chinese etc.)
    By squarefan in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 9 Apr 2009, 10:59 PM
  2. Editor Grid: problem updating japanese characters with ie
    By drif in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 11 Feb 2009, 5:58 PM
  3. [Need help urgently] Japanese charset does not display in the grid
    By nhuyanhuk in forum Ext 2.x: Help & Discussion
    Replies: 7
    Last Post: 12 Jun 2008, 1:57 AM

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar