0

I am currently working on Classic ASP. I want to show string like '₱abc£123@!#$%&*`~<>?';:"\|}{[]+=-*9()0€₼лв៛₡₱₴' which contains special symbols and currency symbols.But these special and currency symbols are showing as ?.

this issue not about unicode characters but is about special symbols.

I have added the below code but I am still facing this problem

HTML: content-type: text/html; charset=utf-8

VB script : <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>

Also added Response.CodePage = 65001 Response.CharSet = "utf-8"

KMat
  • 1
  • 1
  • Possible duplicate of [Convert UTF-8 String Classic ASP to SQL Database](https://stackoverflow.com/questions/21866225/convert-utf-8-string-classic-asp-to-sql-database) – user692942 Aug 23 '18 at 17:12
  • You need to understand that displaying characters isn’t just a case of adding those various lines of code, factors such as; How is the ASP page encoded *(saved in an IDE)*, is the data being displayed in the expected encoding *(you can just take a specific encoded data and switch the page encoding and expect things to work)*. Please consider [this answer](https://stackoverflow.com/a/21914278/692942) from the duplicate question. – user692942 Aug 23 '18 at 17:16
  • 1
    It’s worth noting that there is no difference between alphanumeric characters and *”special symbols”* what does make a difference is the encoding used. – user692942 Aug 23 '18 at 17:27
  • Thanks Lankymart.. I have checked the page and it is saved in UTF-8.. – KMat Aug 23 '18 at 17:27
  • For example, you could send symbols encoded to the page as Windows-1252 and try to display them using UTF-8 and will get an encoding mismatch *(denoted in most browsers using a `?`)* everytime. – user692942 Aug 23 '18 at 17:30
  • Can you please explain the above statement a little more in detail.. – KMat Aug 23 '18 at 17:36
  • Related: [What is the proper way to URL encode Unicode characters?](https://stackoverflow.com/q/912811/692942) – user692942 Aug 23 '18 at 21:23
  • It would be helpful to know if your special characters are hard coded into the page or are coming from another source - eg a database or a feed. Whenever I see a question like this I post this link: [Internationalization and Classic ASP](https://www.hanselman.com/blog/InternationalizationAndClassicASP.aspx) – John Aug 24 '18 at 15:21
  • @John it’s a good article *(seen it many times)* but even that doesn’t fully explain it. Agree though, we need to know where the data is coming from before we can properly help. In other words, there isn’t enough to go on. – user692942 Aug 24 '18 at 16:17
  • the value comes from database – KMat Aug 25 '18 at 05:28
  • 1
    @KMat What “database”? MySql, Oracle, SQL Server, hopefully not MS Access...point is we are not mind readers, how do you expect us to help without key information like this? Not all databases are made equal *(different architectures, different storage methods it all makes a difference)*. – user692942 Aug 25 '18 at 13:33
  • SQL Server..aplologies for not adding it earlier – KMat Aug 27 '18 at 05:46
  • 1
    @KMat Try the divide and conquer technique. Test the web page/web server with a static page. Test the database code with a standalone script for cscript.exe/wscript.exe (but be careful to interpret the results without distortion, such as a writing to a file and inspecting bytes). – Tom Blodget Aug 28 '18 at 23:30

1 Answers1

0

In IIS, open the ASP property page for the website; Set Code Page to 65001.

Your other steps are important, too. But, this will ensure that the processing begins with UTF-8.

Tom Blodget
  • 20,260
  • 3
  • 39
  • 72
  • Or `<% @CodePage=“65001” %>`. – user692942 Aug 24 '18 at 14:59
  • How will this help if it turns out their database isn’t returning unicode data? That’s the problem with answering an incomplete question, you haven’t got enough information to give a useful answer. – user692942 Aug 25 '18 at 13:36
  • Of course it won't if the problem doesn't relate to ASP. It answers the question as an alternative to what was tried. If it has been tried and doesn't help then the question can be changed to the point that this is no longer an answer and I would delete it. – Tom Blodget Aug 25 '18 at 13:45