PDA

View Full Version : Character encoding



mnugter
22 Feb 2007, 5:27 AM
I'm having some problems with character encoding in the grid.

I'm using json to load the data into the grid. The data contains some special characters ( for example).

When I directly display the result from my query the character is displayed correctly. After json_encoding it the result is:

{"debiteur_id":"1","naam":"name","plaats":"city","adres":"adress","contactpersoon":"nam\u0000"}

As you can see it's now a \u0000.

When displaying the data in the grid firefox just ignores this character (displaying nam, it should have been nam) and ie stops rendering the data.


Adding a CONVERT(col USING ASCII) solves the problem but now ? tokens are displayed, not a very neat solution...


Any ideas?

jack.slocum
22 Feb 2007, 6:35 AM
Did you set the content type on you server so the browser knows to decode it? You really shouldn't have to do anything manually.

mnugter
23 Feb 2007, 12:46 AM
It seems that json_encode ruined my data by encoding it incorrectly ( resulted in \u0000). I modified the PEAR package Services_JSON to use mb_convert_encoding which seems to work perfectly.

gizzmo
23 Feb 2007, 1:17 PM
Anyone managed to use inline editing with a POST to a domino agent, using values containing , , .
All special characters turns out wrong in Domino. If anyone succeeded, please tell me the settings on the server.