ASP Unicode!

H

Hans

Hi!

I have an ASP page that I want to support multiple languages. If I set the
<%@ Language=VBScript CodePage=65001%>

and adds a
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

meta tag it seems to work OK. Now instead of setting the codepage in every
page I tried adding a global.asa (Session_onStart) file and add
session.codepage=65001 and also tried to add response.charset="utf-8" (I was
not allowed to set <%@ Language=VBScript CodePage=65001%> inside
global.asa). This does not seems to work though.

Is it possible to set a codepage in some event in a global.asa to make it
global for the entire application? Is it possible to add a directive in
global.asa that works like setting a <meta http-equiv="Content-Type"
content="text/html; charset=utf-8">. If this is possible I don't have to
recomplie my business logic that creates the html.

Regards
/Hans
 
M

Mark Schupp

You should be able to set session.codepage in Session_onStart but I think
you will have to set response.charset on each page.

You can set the content-type for the virtual directory by setting a custom
HTTP header

Name: Content-Type
Value: text/html; Charset=utf-8

I would only do that if I was desperate however as you would be unable to
set content type via ASP code if you did that.
 
H

Hans

Hi Mark and thanks for you answer!

Setting <%@ Language=VBScript CodePage=65001%> in all asp pages (excuding
files that are include files) and setting the extra header like you
suggested seems to do the trick. At least I don't have to add <meta> tags
everywhere to make IE choose the right encoding.

Regards
/Hans
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,813
Messages
2,569,696
Members
45,480
Latest member
CrazyMember

Latest Threads

Top