TheCarver
TheCarver

Reputation: 19723

Funny character coming from a database

I do not understand what this weird symbol represents Orits� Williams. It was inserted in to the database by a member of our office, using a CMS, and when printed to the screen it comes out like the above example.

Can anybody tell me what it is and how I could replace or escape it? I'm thinking it has something to with the letter "e", to make "Ortise".

Upvotes: 1

Views: 103

Answers (2)

Average Joe
Average Joe

Reputation: 4601

use this function below to expose all the chars one by one to see their ASCII,

Sub ExposeAllChars(yourInput)

    Dim lLoop,sNew,iChr,dim curChar,length_of_your_input

    length_of_your_input = Len(yourInput)

    For lLoop = 1 To length_of_your_input

        curChar = Mid(yourInput, lLoop, 1)

        iChr = Asc(curChar)

        Response.write "<li>char:[" & curChar & "] = ascii value:[" & iChr & "]"

    Next

End sub

then you can deal with the problem knowing which ascii char is the troublemaker...

then you can use the htmlcharset to get that special char written properly

Upvotes: 0

RobV
RobV

Reputation: 28655

It is possible that your database is set to ASCII but your web application to UTF-8 (or vice versa)

Thus either the database has malformed data which the web app cannot display or the web app is trying to display a UTF-8 character as ASCII

What is the type of the field in the database?

If it is VARCHAR then your database is ASCII whereas if it is NVARCHAR then it is likely UTF-8. Even if your field is NVARCHAR a poorly written web app may have inserted the data improperly resulting in malformed data in the field.

Upvotes: 1

Related Questions