Solved

Sending foreign characters from page to page using query string

Posted on 2008-06-15
13
658 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
 
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
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…

760 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

19 Experts available now in Live!

Get 1:1 Help Now