Sending foreign characters from page to page using query string

Hello,

I posted a question earlier today about problem with foreign characters. I thought that the problem was solved but, actually, it was partially solved.

I am trying to send parameters from 1 page to another using query string, the following way:

var retVal = window.showModalDialog('EntitiesList.aspx?name=" + name, window, 'dialogWidth:220px');

When my 'name' parameter contains foreign characters (for example, Montó or María), the value received at the destination page has a square (box) instead of the special letter.
I was offered to change the encoding of the application to "ISO-8859-1" and so i did.
It helped with some of the characters but not with all characters.
For example, it helped with French but not Hebrew characters.

Is there a way to transfer all kinds of characters from 1 page to another?

Thank you
RelegenceAsked:
Who is Participating?
 
Michel PlungjanConnect With a Mentor IT ExpertCommented:
Try the attached


utf8test.zip
0
 
Airyck666Commented:
You need to encode the url (and decode when reading the url)

var url = encode("EntitiesList.aspx?name=" + name);
var retVal = window.showModalDialog(url, window, 'dialogWidth:220px');

Open in new window

0
 
Airyck666Commented:
Sorry.......... Correction... don't know what I was thinking.  it's escape() and unescape()
var url = escape("EntitiesList.aspx?name=" + name);
var retVal = window.showModalDialog(url, window, 'dialogWidth:220px')

Open in new window

0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
RelegenceAuthor Commented:
Thanks but that didn't help...
0
 
Michel PlungjanIT ExpertCommented:
What codepage is the result page in and what codepage is the page where you enter the data?

Make both UTF-8 and you should be ok
0
 
RelegenceAuthor Commented:
I tried UTF-8 and it didn't help.
What did help was changing the encoding to 'iso-8859-1' but this is only a partial solution because it is only for latin charactersa and i need a solution for all languages.
0
 
Michel PlungjanIT ExpertCommented:
So you need to make UTF-8 work.
0
 
RelegenceAuthor Commented:
But It didn't :-(
0
 
Michel PlungjanIT ExpertCommented:
That is not a very complete reply.

If you send data in 8859-1 and just change the codepage, it will not work

The data you have must be in UTF-8, it obviously is not.

So I repeat. You need to make UTF-8 WORK and not just change a line somewhere, see it does not work and then give up...
0
 
RelegenceAuthor Commented:
sorry, i probably missed something.
I don't know how to make utf-8 work. What should I do in order to make it work?
0
 
Michel PlungjanIT ExpertCommented:
Where does name come from - a form or a database?
0
 
RelegenceAuthor Commented:
The user inserts it to a textbox. I am trying to send it to a modalWindow and there it "breaks"
0
 
RelegenceAuthor Commented:
Thank you.

I'll try to use that in my application.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.