Forum Moderators: phranque

Message Too Old, No Replies

Names with 'special' characters passed through URL

Seems to fail on our site

         

giggle

5:29 am on Jul 14, 2008 (gmt 0)

10+ Year Member



Hi

(Sorry if this is the wrong place for this question)

I noticed that when a customer from a country that uses accented characters in their alphabet that their query usually fails at some point of the creation process.

What's the best way that I can either convert, strip or encode the name field to stop this.

Actually, I have no idea how to handle this best.

I use an SQL database and the name field is set to nvarchar which should be able to handle any character, but it seems like the URL is being corrupted.

I'm using ASP and II6.

Thanks

Mick

rocknbil

5:25 pm on Jul 14, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



their query usually fails

Do you mean "query" as in database query?

If you do things like this,

insert into table (field) values('some value');

Any single quote will error, you need to either double it, escape it or encode it:

insert into table (field) values('it''s a boy!');
insert into table (field) values('it\'s a boy!');
insert into table (field) values('it%27s a boy!');

If it's not that, you might look into the encoding used for your database.