?
Solved

Issues with french characters

Posted on 2005-04-29
6
Medium Priority
?
315 Views
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
test=cstr(request.querystring("subject"))
test=replace(test,"é","é")
 any ideas
0
Comment
Question by:jayham
6 Comments
 
LVL 20

Assisted Solution

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

<% @ LANGUAGE=VBScript CODEPAGE=850%>
0
 

Author Comment

by:jayham
ID: 13896857
no luck
0
 
LVL 7

Accepted Solution

by:
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  ).
0
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

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

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

Expert Comment

by:anthonywjones66
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
Else
  '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.

Anthony.
0

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