Solved

Sending foreign characters from page to page using query string

Posted on 2008-06-15
13
675 Views
Last Modified: 2011-10-19
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
0
Comment
Question by:Relegence
  • 6
  • 5
  • 2
13 Comments
 
LVL 2

Expert Comment

by:Airyck666
ID: 21790187
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
 
LVL 2

Expert Comment

by:Airyck666
ID: 21790193
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
 

Author Comment

by:Relegence
ID: 21790978
Thanks but that didn't help...
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 21791223
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
 

Author Comment

by:Relegence
ID: 21791278
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
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 21791397
So you need to make UTF-8 work.
0
 

Author Comment

by:Relegence
ID: 21791449
But It didn't :-(
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 21791488
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
 

Author Comment

by:Relegence
ID: 21791538
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
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 21791598
Where does name come from - a form or a database?
0
 

Author Comment

by:Relegence
ID: 21791633
The user inserts it to a textbox. I am trying to send it to a modalWindow and there it "breaks"
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 500 total points
ID: 21791739
Try the attached


utf8test.zip
0
 

Author Comment

by:Relegence
ID: 21791895
Thank you.

I'll try to use that in my application.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now