Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert to URL-coded string

Status
Not open for further replies.

ZakiMaksyutov

Programmer
Feb 28, 2001
87
RU
Hi!

I need to write one function on VBScript (or JavaScript).
This function receive one string as parameter and should return URL-coded string. It means following: every symbol writes as "%$$", where $$ - 16-value of this symbol, the ANSI symbol occupies one byte, but russian (f.i.) symbol occupies two bytes: "%$$%$$", japanese three bytes (UTF8-coded string).

May be anyone knows how it should be done?

Thanks for any help...
 
I'm pretty sure that's the escape(string) function --

Use unescape(string) to convert back...

Try that

Paul Prewett
 
It's a javascript funtion...

I know it works in javascript... maybe use that instead of vbScript
 
No, I need another...

this function do following:
"test"->"test", russian character -> "%u$$$$",
but I need:
"test"->"%74%65%73%74"

I need convert string to UTF8-coded string. In this format English characters occupy one byte, Russian - two and Japaniese - 3 bytes...

But escape convert characters to unicode format, where all characters occupy 2 bytes. Beside this, this function depends from charset (Unicode, Windows-1251, etc.).

May be anyone can help me?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top