ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 4th, 2012, 01:11 PM
tcbuist tcbuist is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2012
Posts: 5 tcbuist User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 37 sec
Reputation Power: 0
Question Parsing Korean characters through ASP

Hello all,

I'm using ASP to grab data from an excel file stored on the server and display it on a page. The problem I'm having is that Korean characters are not showing up. Instead, I'm getting question marks.

Here's my code.

Code:
<html>
<head>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="949"%>
</head>
<body>

<%

Response.CodePage = 65001
 
Dim objConn, objRS, strSQL
Dim x

Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "DRIVER={Microsoft Excel Driver (*.xls)}; IMEX=0; HDR=NO; "&_
	"Excel 8.0; DBQ=" & Server.MapPath("test-input.xls") & "; "

strSQL = "SELECT * FROM A1:Q10000"
Set objRS=objConn.Execute(strSQL)
Response.Write("<table border=""1"">")
Response.Write("<tr>")
For x=0 To objRS.Fields.Count-1
   Response.Write("<th>" & objRS.Fields(x).Name & "</th>")
Next
Response.Write("</tr>")
Do Until objRS.EOF
	Response.Write("<tr>")
	For x=0 To objRS.Fields.Count-1
		Response.Write("<td>" & objRS.Fields(x).Value & "</td>")
	Next
	Response.Write("</tr>")
	objRS.MoveNext
Loop
objRS.Close
Response.Write("</table>")
objConn.Close
Set objRS=Nothing
Set objConn=Nothing
%>
</body>
</html>


The funny thing is...
Code:
Response.Write("<th>" & objRS.Fields(x).Name & "</th>")
displays the Korean characters just fine... but
Code:
Response.Write("<td>" & objRS.Fields(x).Value & "</td>")
gives me the ???'s.

Can anyone shed any light on this, and on what I should do to fix it?

Thanks,

Tam.

Reply With Quote
  #2  
Old September 4th, 2012, 04:49 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Jun 2003
Posts: 14,237 Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Weeks 14 h 43 m 55 sec
Reputation Power: 4445
I don't do multi-lingual coding, but my guess from your description is that the data is being inserted in your db with the wrong encoding, which is why the column names are correct but not the value data.

Just a guess though.
__________________
======
Doug G
======
It is a truism of American politics that no man who can win an election deserves to. --Trevanian, from the novel Shibumi

Reply With Quote
  #3  
Old September 4th, 2012, 06:45 PM
tcbuist tcbuist is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2012
Posts: 5 tcbuist User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 37 sec
Reputation Power: 0
Thanks for the input, but the data is coming direct from the excel spreadsheet, which has the Korean characters in it... I have a local copy on my machine and the Korean characters are fine there...

I did have a thought though... it could be that my host doesn't have the Korean language pack on their excel install... and if that's the case, I'm humped.

Reply With Quote
  #4  
Old September 7th, 2012, 10:15 AM
tcbuist tcbuist is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2012
Posts: 5 tcbuist User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 37 sec
Reputation Power: 0
Bump.

I have still had no success with this problem. No matter what I do I cannot get the Korean characters in my excel spreadsheet to survive into the recordset.

I've determined it's not the server's problem. That's because Response.Write(objRS.Fields(x).Name) displays the Korean characters in the 1st row of my spreadsheet.

It's only Response.Write(objRS.Fields(x).Name) that displays '???' instead of the characters.

I have saved the excel spreadsheet in UTF-8 format, I have the codepage set to '65001' in the <@ %> at the top and the charset set as "utf-8". My asp page has also been saved in utf-8 format, and nothing makes a difference. If anyone could please, please tell me how to solve this weird problem, I would be forever grateful, I'm tearing my hair out here.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Parsing Korean characters through ASP

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap