I'm trying to move some old classic ASP website to Azure App Service. The webpages work fine, but show national characters from varchar
columns as question marks.
How to reproduce:
Create a SQL Server database (on Azure or on other SQL Server) with
Cyrillic_General_100_CI_AS collation
Create the table with
varchar
andnvarchar
columns:create table dbo.Test ( id int identity (1,1) not null, code varchar(255) null, name nvarchar(255) null )
Insert some test data:
insert dbo.Test (code, name) values ('привет-1', N'привет-2') insert dbo.Test (code, name) values ('привет-3', N'привет-4')
Ensure that data is selected fine in SSMS:
select * from dbo.Test: id code name 1 привет-1 привет-2 2 привет-3 привет-4
Create a webpage that displays data:
id code name 1 ??????-1 привет-2 2 ??????-3 привет-4
So, the nvarchar
columns show up fine, but varchar
columns do not. Using the following code on the Azure web page doesn't help:
Response.CharSet = "windows-1251"
Response.CodePage = 1251
Session.CodePage = 1251
On "regular" IIS everything is shown fine - maybe because it has "ASP encoding" setting. Anybody knows how to fix that on Azure?
Thanks in advance
nvarchar
for anything Cyrillic and be done with it ! Cyrillic characters do need the Unicode support that only thenvarchar
datatype can provide. So what exactly is the question then?? Just usenvarchar
:... – marc_s