0

I have a ASP page.I am fetching data from database.In the database the character are all Russian.But when I fetch that data to show in the webpage it render as '?' marks.

oCommBM.Parameters.Append oCommBM.CreateParameter("@menu", adVarChar, adParamOutput,2000, "0")

I am passing the parameter like that.If instead of adVarChar I used aVarWCahr then it's showing the Russian character but the below contained not render properly.

I checked by execute store procedure from database.There it's showing fine. Also I add below 2 lines in the asp page.

Response.codePage = 65001
Response.Charset = "UTF-8"

I changed every possible encoding type from asp page code as well as from Notepad++ encoding type.

Any suggestion is greatly appreciated.Thanks in advance.

Cheran Shunmugavel
  • 8,319
  • 1
  • 33
  • 40
amit ghosh
  • 276
  • 1
  • 4
  • 15
  • provide all code, can't tell where the issue is from what you've provided – BlackICE Jul 10 '13 at 07:07
  • `.If instead of adVarChar I used aVarWCahr then it's showing the Russian character but the below contained not render properly.` can you explain that a bit more ? – Flakes Jul 10 '13 at 08:06
  • actually this portion is for menu.If I add aVarWchar then in menu it's showing the Russian character in menu but the bottom portion of the page not rendering properly..I think some exception occur so the remaining page not loading correctly. – amit ghosh Jul 10 '13 at 10:14

1 Answers1

0

Firs part: recover from DB

When you use aVarWChar, the W is for "Wide", which means that this parameter is an Unicode string. Unicode support all languages without problem, so it's the way to go.

When you use aVarChar, the string is encoded in some other way, but not in Unicode (It could depend on the server configuration, or something else. I don't know if you can control it. ASP it's such old technology!!)

SO your best bet is to recover Unicode from the DB and let ASP encode it for the browser.

Second part: show in ASP page

Look at this: Classic ASP: How to write unicode string data in classic ASP? This shows how to get ASP to encode the Unicode string in a way that the browser will show it correctly.

Community
  • 1
  • 1
JotaBe
  • 38,030
  • 8
  • 98
  • 117