Issues with french characters

Posted on 2005-04-29
Medium Priority
Last Modified: 2008-02-01
Ok here is what I have
I have content being pulled from a DB
"Gestion des déchets"
I am trying to compare it to a value in the querystring
"Gestion des déchets"
I am assuming they are not equal because of the special character.
I have tried replacing the é with é but it does not seem to find it
 any ideas
Question by:jayham
LVL 20

Assisted Solution

jitganguly earned 750 total points
ID: 13896712
Try putting french codepage value at the top of ASP


Author Comment

ID: 13896857
no luck

Accepted Solution

wesbird earned 750 total points
ID: 13896871
You are right that one problem you have is that &#233; does not mean anything except just that to VBscript on the ASP page - only to the rendering engine, be it XML or some flavour of XHTML.  The other problem though is that your querystring has spaces in and will be urlencoded.  You could try comparing with your querystring with ..  Server.URLEncode( string  ).
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 20

Expert Comment

ID: 13896891
Why not use replace function from SQL itself ? So when data comes to you it is already formatted ?

Select replace(test,"é","&#233;")

Expert Comment

ID: 13900226
Here's an idea (a little ugly but it'll work)

Load the string into an xml DOM.  That will parse the string correctly.

Dim s: s = "Gestion des d&#233;chets"
Dim s1: s1 = "Gestion des déchets"
Dim s2

Dim dom = Server.CreateObject("MSXML2.DOMDocument")

dom.loadXML("<x>" & s & "</x>")

s2 = dom.documentElement.text

If s1 = s2 Then
  'They are equal
  'No they're not
End If

Of course the serious solution is to stop storing the escape sequences in the DB in the first place.  If its a SQL Server DB then change the field that stores the values to an nvarchar field.  If it's an MDB then it will already be able to store unicode characters.


Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

864 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