Can someone show me a simple ASP script that produces a unicoded webpage? Maybe you could write Hello world in a variety of languages.
Also how can I convert floats to string so that I can produce "2.3" or "2,3" depending on the country the page is being directed to. Does ASP offer functionality for doing this?
Furthermore, how do you convert "A B"
to "A B"
etc.
There are two parts in creating a true Unicode (utf-8) page. First you will need to output the data as utf-8. To instruct the web server to use utf-8, put this line at the top of your asp-file.
<%
response.codepage = 65001
response.charset = "utf-8" '//This information is intended for the browser.
%>
Secondly, you'll need to tell the browser which encoding you are using. Put this information the html head tag.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
Remember that hard-coded text (in an ASP-file) will be outputted "as is", therefore save the file as utf-8 on disk.
Also how can I convert floats to string so that I can produce "2.3" or "2,3" depending on the country the page is being directed to. Does ASP offer functionality for doing this?
Use LCID to change how dates, numbers, currency etc is formatted. Read more here!
<%
Session.LCID = 1053 'Swedish dateformat (and number format)
%>
Furthermore, how do you convert "A B" to "A B" etc.
This is very easy. Just use Server.HTMLEncode(string)
<%
Server.HTMLEncode("A B") '//Will output A B
%>
<%
'//This page is encoded as utf-8
response.codepage = 65001
response.charset = "utf-8"
'//We use the swedish locale so that dates and numbers display nicely
Session.LCID = 1053 '//Swedish
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<%
Server.HTMLEncode("Hello world!") '//English
Server.HTMLEncode("Hej världen!") '//Swedish
Server.HTMLEncode("Γεια σου κόσμε!") '//Greek
Server.HTMLEncode("!سلام دنیا") '//Persian
%>
</body>
</html>