Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Using Non ASCII Characters

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,367
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> Using Non ASCII Characters
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Using Non ASCII Characters - 9/3/2001 2:32:37 PM   
  crazy_legs1

 

Posts: 1
Score: 0
Joined: 9/3/2001
From:
Status: offline
I am trying to pass non ascii characters from one page to the other. The user enters a string in the first page:

<html>
<body>
<form action="test2.asp" method=post>
<input type="text" name="label1"/>
<input type="reset" value="reset data"/>
<input type="submit" value="submit data"/>
</form>
</body>
</html

The second page mearly displays what the user entered.

<html>
<body>
You typed:<%= Request.Form("label1")%>
</body>
</html>

When I enter a non ascii character I always get the wrong one on the next page. Does VBScript have build in support for unicode? If so how do I use it?
 
 
Post #: 1
 
 Re: Using Non ASCII Characters - 9/4/2001 2:31:32 AM   
  cruiser

 

Posts: 25
Score: 0
Joined: 6/4/2001
From: USA
Status: offline
Found this interesting script.

'**************************************
' Name: UNICODE Convert to char - Conver
' sion without database
' Description:Show how to convert Unicod
' e to char. It will be usefull when knowi
' ng what has on a URL means something to
' you. For instance, if people get to your
' site from a search engine. What did they
' typed to get on your site.
There is much more into this.
The real subject is web marketing.
if someone has news on it please Let me know.
' By:
'
' Inputs:' your vote is appreciated
'
' Returns:' your vote is appreciated
'
'This code is copyrighted and has ' limited warranties.Please see http://w
' ww.Planet-Source-Code.com/xq/ASP/txtCode
' Id.6819/lngWId.4/qx/vb/scripts/ShowCode.
' htm 'for details. '**************************************

<%@ Language=VBScript %>
<%
' Show how to convert Unicode to char. I
' t will be usefull when knowing what has
' on a URL means something to you. For ins
' tance, if people get to your site from a
' search engine. What did they typed to ge
' t on your site.
' There is much more into this.
' The real subject is web marketing.
' If someone has news on it please let m
' e know. marcio@diamond.com
Dim varUnicode
Dim showUnicode
Dim I
Dim intPosition
if Len(Request.QueryString("text2")) > 0 Then

varUnicode = Request.QueryString("text2")

For I = 30 To 255
intPosition = instr(1, UCASE(varUnicode), "%" & UCase(Hex(I)))
if intPosition <> 0 Then
showUnicode = REPLACE(varUnicode, "%" & UCase(Hex(I)), chr(I), 1, -1, 0)
showUnicode = REPLACE(showUnicode, "%" & LCase(Hex(I)), chr(I), 1, -1, 0)
varUnicode = showUnicode
End if

Next
End if

%>
<HTML>
<HEAD><LINK rel="stylesheet" type="text/css" href="../Style Sheet1.css">
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY ><BR><BR>
<CENTER><H2> Unicode Conversion </H2>
<FORM NAME="Unicode" ACTION="UnicodeReplace1.asp" METHOD="get">
<TABLE WIDTH="75%" BGCOLOR=white BORDER=1 CELLSPACING=1 CELLPADDING=1 style="HEIGHT: 100px; WIDTH: 976px" >
<TR>
<TD>Enter URL With Unicode <BR> (i.e. %22 and so on..)</TD>
<TD><INPUT id=text2 name=text2 value="adoublequotehere%22+andacommahere%3b&itwillbeusefull" style="HEIGHT: 22px; WIDTH: 782px"></TD>
</TR>
<TR>
<TD>Here is the Results.</TD>
<TD><INPUT id=text1 name=text1 value="<%=server.htmlencode(showUnicode)%>" style="HEIGHT: 22px; WIDTH: 782px"></TD>
</TR>
<TR>
<TD COLSPAN=100><CENTER><INPUT type="button" value="Convert From Unicode to Char" ONCLICK="submit();" id=button1 name=button1 style="HEIGHT: 24px; WIDTH: 228px"></CENTER></TD>

</TR>
</TABLE>
<P> </P></CENTER></FORM>
</BODY>
</HTML>

(in reply to crazy_legs1)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> Using Non ASCII Characters Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts