473,394 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

ASP Unicode!

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
Jul 19 '05 #1
2 11498
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.

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Hans" <no****@sorry.com> wrote in message
news:c1**********@yggdrasil.glocalnet.com...
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

Jul 19 '05 #2
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
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Michael Weir | last post by:
I'm sure this is a very simple thing to do, once you know how to do it, but I am having no fun at all trying to write utf-8 strings to a unicode file. Does anyone have a couple of lines of code...
8
by: Bill Eldridge | last post by:
I'm trying to grab a document off the Web and toss it into a MySQL database, but I keep running into the various encoding problems with Unicode (that aren't a problem for me with GB2312, BIG 5,...
8
by: Francis Girard | last post by:
Hi, For the first time in my programmer life, I have to take care of character encoding. I have a question about the BOM marks. If I understand well, into the UTF-8 unicode binary...
48
by: Zenobia | last post by:
Recently I was editing a document in GoLive 6. I like GoLive because it has some nice features such as: * rewrite source code * check syntax * global search & replace (through several files at...
4
by: webdev | last post by:
lo all, some of the questions i'll ask below have most certainly been discussed already, i just hope someone's kind enough to answer them again to help me out.. so i started a python 2.3...
2
by: Neil Schemenauer | last post by:
python-dev@python.org.] The PEP has been rewritten based on a suggestion by Guido to change str() rather than adding a new built-in function. Based on my testing, I believe the idea is...
10
by: Nikolay Petrov | last post by:
How can I convert DOS cyrillic text to Unicode
6
by: Jeff | last post by:
Hi - I'm setting up a streamreader in a VB.NET app to read a text file and display its contents in a multiline textbox. If I set it up with System.Text.Encoding.Unicode, it reads a unicode...
13
by: Tomás | last post by:
Let's start off with: class Nation { public: virtual const char* GetName() const = 0; } class Norway : public Nation { public: virtual const char* GetName() const
24
by: ChaosKCW | last post by:
Hi I am reading from an oracle database using cx_Oracle. I am writing to a SQLite database using apsw. The oracle database is returning utf-8 characters for euopean item names, ie special...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.