PDA

View Full Version : International Language



Jose Sousa
18 Jul 2009, 3:18 AM
Hi, Why, one simple combox canīt read portuguese characters, like é, ã, į, etc. ?

Condor
18 Jul 2009, 3:27 AM
A combobox doesn't 'read' anything. Do you mean the store?

For international characters to be visible:
1. The html must be served using a charset that support the characters (e.g. UTF-8).
2. The data for the store must also use that charset.

Jose Sousa
18 Jul 2009, 3:47 AM
Hi, thankīs

My index.html have:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//PT"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pt" lang="pt">

But i have the same problem...

See the attachments...

15091

The problem are in JsonRead, it only work UTF-8 ?

var profs = new Ext.data.Store({
reader: new Ext.data.JsonReader({
fields: [{name:'nome', type:'string'}],
root: 'rows'
}),
proxy: new Ext.data.HttpProxy({
url: 'leruser.php'
}),
autoLoad: true
});

Donīt exist other way to store data ?...

Condor
18 Jul 2009, 11:34 PM
Marking the HTML as UTF-8 doesn't make it UTF-8. The server must send it with a charset=UTF-8 in the content type.

The same is true for the JSON data.

(another characterset that supports Portuguese would also be possible, but UTF-8 is widely accepted by browsers)

steffenk
19 Jul 2009, 3:34 AM
I highly suggest utf-8 for serverside. I struggled a long time with latin1 and other charsets, but JS general use utf-8, so you can save a lot of time and prevent grey hairs by using utf-8 in general ;)