Sigma Php Ajax framework, Ajax Components, GUI Builder
February 12, 2012, 12:49:02 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: dealing with iso-8859-1 characters and linb.Dom.submit  (Read 634 times)
btoven
Jr. Member
**
Posts: 5


View Profile
« on: August 08, 2010, 05:32:47 PM »

Hi,
I want to fill some Html file with some data I filled in an APP.
The Html text in my code has iso-8859-1 characters, when I use

linb.Dom.submit('./myhtml.php',{nom : "posData:áéíóú" },'post');

I obtain text other than I want:

The ./myhtml.php file has this code:



And the code that is displayed in the new window is:
posData:áéíóú

What is the trick to obtain the same characters I send?
Thanks.
Logged
linb
Administrator
Hero Member
*****
Posts: 433


View Profile
« Reply #1 on: August 08, 2010, 05:42:39 PM »

Set "UTF-8" in your server side.
Logged
btoven
Jr. Member
**
Posts: 5


View Profile
« Reply #2 on: August 14, 2010, 02:54:03 AM »

Hi, thanks for your answer.
How about if I can not deal with the server side. I want to request from the clients side. what is the problem with this:

linb.Dom.submit('./myhtml.php',{nom : "posData:áéíóú" },'post','application/x-www-form-urlencoded;charset=UTF-8');

That is not working for me!

Any idea?
.
Logged
linb
Administrator
Hero Member
*****
Posts: 433


View Profile
« Reply #3 on: August 14, 2010, 05:14:16 AM »

If the second parameter is object, the lib will serialize it to string in UTF-8.

In your case, You need sets the second parameter to string.


_.stringify({nom : "posData:áéíóú" })        =>  '{"nom":"posData:áéíóú"}'
_.serialize({nom : "posData:áéíóú" })        =>  '{"nom":"posData:\u00e1\u00e9\u00ed\u00f3\u00fa"}'
Logged
btoven
Jr. Member
**
Posts: 5


View Profile
« Reply #4 on: August 16, 2010, 09:06:44 AM »

Hi,
I am still having problems with that.
If I use what you say and write:
linb.Dom.submit('./myhtml2pdf.php',_.serialize({nom : "posData:áéíóú" }),'post','application/x-www-form-urlencoded;charset=UTF-8');
The submit function does not send the parameter to the php file. I check that putting:
var_dump($_POST);
I try writing on the second parameter something like:

var  nom = “áéíóú”;
.... { nom: _.serialize(nom)}

But still is not working.
Sorry, any idea?
...
Logged
linb
Administrator
Hero Member
*****
Posts: 433


View Profile
« Reply #5 on: August 16, 2010, 05:23:07 PM »

No idea, maybe you need to monitor the http message with fiddler or other tool
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!