Issues with french characters

Posted on 2005-04-29
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

    Try putting french codepage value at the top of ASP

    <% @ LANGUAGE=VBScript CODEPAGE=850%>

    Author Comment

    no luck
    LVL 7

    Accepted Solution

    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  ).
    LVL 20

    Expert Comment

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

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

    Expert Comment

    LVL 8

    Expert Comment

    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

    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

    Suggested Solutions

    I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
    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 video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    730 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

    16 Experts available now in Live!

    Get 1:1 Help Now