php - Jquery Table and text with accented characters issue -


i created table dynamically jquery variables (in java array json_encoded php array). after this, variables perfect accented characters. far good. put them in table results bad.

here's code :

<script>     (var j = 0; j < 13; j++) {           // labels              if (j==0) {             var tab_b = tab_b + "<tr><th>" + label_array2[j] + "</th><th>" +              label_array2[j+1] + "</th><th>" + label_array2[j+2] + "</th></tr>";         }         // inputs         if ((j>0) && (j<13)) {             var tab_b = tab_b + "<tr><td><input type='text' name='" + input_array2[(j*3)] +              "' maxlength='33' size='33' value='" + label_array2[(j*3)] + "'/></td><td><input type='text' name='" +              input_array2[(j*3)+1] + "' maxlength='5' size='5' value='" + label_array2[(j*3)+1] +              "'/></td><td><input type='text' name='" + input_array2[(j*3)+2] +              "' maxlength='6' size='6' value='" + label_array2[(j*3)+2] + "'/></td></tr>";         }     }  $("#recipetable").html(tab_b); </script> 

then display table :

  <table  class="reference" border="1" cellpadding="0" width="100%" id="recipetable"></table> 

some texts truncated :

example :

before : pain d'épices

after : pain d

am missing ?

truncation comes not protecting quotes. it's simple thing. accents, must know json requires utf8 encoding. if doesn't answer problem, please make fiddle us.


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -