LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-07-2009, 12:15 PM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Rep: Reputation: 83
Question JS, Sajax and UTF8


Well.. those three can be a real headache, right?

Well.. let's see what's going on. I'm trying to send this string through sajax to my php script:
Code:
Huáscar
That would be Hu\uc3a1scar (is that right?)

On the wire, FF(Sajax) is sending: Hu%E1scar and what I get in PHP is:
Code:
Hu�scar
The � is \341 (0x48 0x75 0xe1 0x73) on the wire, in other words: Hu\341scar (I died and saw what the wire brings).

What trick do I have to try? For example, I tried using escape on JS and rawurldecode on PHP, but this is the result:
On the wire on the request (sajax):
Code:
Hu%25E1scar
On the response:
Code:
Hu�scar
Hu\341scar. Well... at least the escape/rawurldecode pair is concise. But then what do I have to do so that the 'á' arrives as an 'á' on php?

Thanks in advance!
 
Old 01-07-2009, 12:52 PM   #2
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
I made a little mistake in the previous post. I said á was \uc3a1, and it's \u00e1. Everything else stands.
 
Old 01-07-2009, 04:03 PM   #3
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
I removed sajax and used plain old ajax instead and it's working now. Didn't have to use any encoding/decoding procedure to get it working with UTF-8. Thanks anyway, guys!

PS It's too bad I'll have to remove sajax from development, cause I've really liked it so far.
 
Old 08-30-2009, 10:39 AM   #4
AJenbo
LQ Newbie
 
Registered: Aug 2009
Posts: 4

Rep: Reputation: 0
Hi, I just wanted to tell you that sajax 0.13 has full UTF-8 support.
You can get it at http://sajax.info/.

Hope to see you there
 
  


Reply

Tags
javascript, php5, utf8


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
UTF8 support. zakidad Linux - Newbie 3 11-18-2006 07:50 AM
sajax, php, entities, JS and IE eantoranz Programming 2 08-22-2006 04:02 PM
utf8 hraposo Debian 1 08-11-2006 10:59 AM
KDE and utf8 shoki_neu Linux - Software 1 01-10-2005 09:58 AM
Utf8 akasantos Fedora 2 11-18-2003 10:03 AM


All times are GMT -5. The time now is 02:38 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration