By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,375 Members | 1,111 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,375 IT Pros & Developers. It's quick & easy.

Reading and Displaying Japanese data in MS SQL Server using ASP

P: 1
I am using MS SQL Server 2000 and 2005, IIS 5,0 and ASP. I am able to display data that has been selected from a Unicode column in the database in all languages except Japanese (I get question marks when the data is Japanese).

I can get Japanese to display when the text is static, i.e., embedded in the html, but have been unable to display it when it comes from the database.

When I use Access to view the table, I can see that the Japanese text is correct in the database. I have added the meta tag <meta http-equiv="Content-type" content="text/html;charset=utf-8"> as the first line following the <head> tag. My understanding is that I need something comparable in the ASP code. I tried adding the following (bolded line) at the top of the code:
Expand|Select|Wrap|Line Numbers
  1. <%@ Language=VBScript %>
  2. <%Option Explicit%>
  3. Response.ContentEncoding = Encoding.UTF8;
  4. <!-- #INCLUDE FILE="includes/aspConnection.asp" -->
Here's the code where I am getting the data for strModuleIntro:
(Note: I recompiled the stored procedure after I changed the column type to nvarchar),
Expand|Select|Wrap|Line Numbers
  1. Sub ProcessLogin()
  2.   Dim objCmd
  3.   Dim objRst
  5.   Set objCmd = server.CreateObject("ADODB.Command")
  7.   With objCmd
  8.         .ActiveConnection = objCnn
  9.         .CommandType = adCmdStoredProc
  10.         .CommandText = "ModuleIntro_By_Login_Language_ssp"
  11.         .Parameters.Append .CreateParameter("LanguageCode_sz", adVarChar, adParamInput, 3 , strLanguageCode)
  12.         .Parameters.Append .CreateParameter("LoginID_sz", adVarChar, adParamInput, 50, strSubmit)
  13.   End With
  15.   Set objRst = server.CreateObject("ADODB.Recordset")
  17.   With objRst
  18.     .Open objCmd, , adOpenStatic, adLockReadOnly
  20.     if .RecordCount > 0 then
  21.       strLogin = strSubmit
  22.       intModule = .Fields("CurrentModule_l")
  23.       strModuleIntro = .Fields("ModuleIntro_sz")
  24.       strDivDisplayModuleIntroStyle = "Display:Block;" 
  25.       Call DisplayModuleIntro(strModuleIntro, intModule)
  26.     else
  27.       strDisplayLoginProblemStyle    = "Display: block;"
  28.       Call DisplayUserUnknown(strLanguageCode)
  29.     end if
  31.     .Close
  32.   End With
Any help would be greatly appreciated!
Nov 1 '06 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 1,754
Hi there,

Do you have Asian Font Set installed in your server? Check it out.
Nov 1 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.