Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dealing with funny chars - nightmare!!!

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
Hi,

I'm having a total nightmare trying to send a textarea input via AJAX without the charset/unicode characters getting corrupted.

Here is some background... thread219-1594322

I'm now stuck that no matter how I encode the textarea content, it is getting corrupted.

Even Base64 encoding before AJAX transmission is not working.

So why is this happening?

How do I ensure that AJAX sends the data as UTF-8 and how do I ensure it is correctly encoded before transmission?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Google Rank Extractor -> Perl beta with FusionCharts
 
Hi

Just a long shot.
I once had alot of issues with Japanese characters and fixed it by saving the file with encoding set to UTF8
 
Thanks Chris, but I'd already found the Base64 encoding scripts (there are a few).

It doesn't seem to matter, it still corrupts some chars.

I've ensured the content header is set to UTF8 on the initial X/HTML page, i've then encoded the data before sending (base64 & URL).

I've also ensured the DB is set to Ntext (N = uNicode in SQL).

I've also ensured that my perl script uses UTF8 and base64 decoding, nothing works, I get the same result everytime.

The only way I ended up fixing it was with some hardcoded char replacements in my perl script before saving to the DB.

So far I've had no further reports of char corruption!



"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Google Rank Extractor -> Perl beta with FusionCharts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top