473,385 Members | 1,329 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,385 software developers and data experts.

Unicode converter

Is there some Unicode converter to convert javascript to Unicode
format?

thanks
mistral

Jul 10 '06 #1
9 22817
mistral wrote:
Is there some Unicode converter to convert javascript to Unicode
format?
JavaScript is just text, so anything that can read the format the JS is
encoded in and output Unicover.

iconv is a standard UNIX utility for doing this.

Jul 10 '06 #2
mistral wrote:
Is there some Unicode converter to convert javascript to Unicode
format?
I'm not sure what you mean by "converting" a javascript to Unicode.
Perhaps you need UTF-8 support for content of variables etc. Javascript
syntax itself does not require an Unicoded environment. It should be
okay from ISO-8859-1 and up (perhaps even ASCII).

I'ld say you can configure most code editors to save files as Unicode,
such as the ConText-editor (www.context.cx). So just setting such an
option when saving your js code should be sufficient.

--
Bart

Jul 10 '06 #3

David Dorward писал(а):

mistral wrote:
Is there some Unicode converter to convert javascript to Unicode
format?
JavaScript is just text, so anything that can read the format the JS is
encoded in and output Unicover.

iconv is a standard UNIX utility for doing this.
----------------------------------------------

Not find this encoder there.
I tried also ascii to unicode converter, which generate ready html
code; but not work:

<Script Language='Javascript'>
<!--
eval(unescape('%67%67%47%73%67%53%47%73%64'));
//-->
</Script>

and this:

<script
type="text/javascript">document.write('\u0076\u0061\u0072\u00 20\u0073\u0074\u0061\u0079\u003d\u0063\u006f\u006e \u0066\u0069\u0072\u006d\u0028\u0022\u0054\u0068\u 0065\u0020\u0066\u006f\u006c\u006c\u006f\u0077\u00 69\u006e\u0067\u0020\u006f\u006d\u0022\u000d\u000a ')</script>

both methods not work.

mistral

Jul 10 '06 #4

Bart Van der Donck писал(а):
mistral wrote:
Is there some Unicode converter to convert javascript to Unicode
format?
I'm not sure what you mean by "converting" a javascript to Unicode.
Perhaps you need UTF-8 support for content of variables etc. Javascript
syntax itself does not require an Unicoded environment. It should be
okay from ISO-8859-1 and up (perhaps even ASCII).
I'ld say you can configure most code editors to save files as Unicode,
such as the ConText-editor (www.context.cx). So just setting such an
option when saving your js code should be sufficient.
--
Bart
-------------------------------------------------------

I meant simple conversion utility (or some online script) which can
convert normal javascript code into Unicode, which will normally work
on a html page. I tried, but script does not work after conversion.

mistral

Jul 10 '06 #5
mistral wrote:
I meant simple conversion utility (or some online script) which can
convert normal javascript code into Unicode, which will normally work
on a html page. I tried, but script does not work after conversion.
By "Unicode" do you mean "Something which can't easily be read by people
with view source but the browser will still execute"? ... because that is
not Unicode. See http://www.jibbering.com/faq/#FAQ4_1 instead.

--
David Dorward <http://blog.dorward.me.uk/ <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 10 '06 #6
mistral wrote:
Bart Van der Donck писал(а):
[...]
I'ld say you can configure most code editors to save files as Unicode,
such as the ConText-editor (www.context.cx). So just setting such an
option when saving your js code should be sufficient.

--
Bart
-------------------------------------------------------

I meant simple conversion utility (or some online script) which can
convert normal javascript code into Unicode, which will normally work
on a html page. I tried, but script does not work after conversion.
It's still not clear to me, sorry. You can view the source of that HTML
page, then set your Notepad to Unicode or UTF-8 (should be available on
WinXP) and then save the code. Alternatively, configure the browser to
use your favourite Unicode-aware editor for the View Source action.

Or do you mean something else ?

--
Bart

Jul 10 '06 #7
On 10 Jul 2006 10:04:59 -0700, mistral wrote:
both methods not work.
Mabe this could help:

// Copyright & author: Atamyrat Mary, Turkmenistan
// http://www.kanolife.com/escape/
function unicodeEscape (pstrString) {
if (pstrString == "") {
return "";
}
var iPos = 0;
var strOut = "";
var strChar;
var strString = escape(pstrString);
while (iPos < strString.length) {
strChar = strString.substr(iPos, 1);
if (strChar == "%") {
strNextChar = strString.substr(iPos + 1, 1);
if (strNextChar == "u") {
strOut += strString.substr(iPos, 6);
iPos += 6;
}
else {
strOut += "%u00" +
strString.substr(iPos + 1, 2);
iPos += 3;
}
}
else {
strOut += strChar;
iPos++;
}
}
return strOut;
}
Jul 10 '06 #8

Bart Van der Donck писал(а):

mistral wrote:
Bart Van der Donck писал(а):
[...]
I'ld say you can configure most code editors to save files as Unicode,
such as the ConText-editor (www.context.cx). So just setting such an
option when saving your js code should be sufficient.
--
Bart
-------------------------------------------------------

I meant simple conversion utility (or some online script) which can
convert normal javascript code into Unicode, which will normally work
on a html page. I tried, but script does not work after conversion.

It's still not clear to me, sorry. You can view the source of that HTML
page, then set your Notepad to Unicode or UTF-8 (should be available on
WinXP) and then save the code. Alternatively, configure the browser to
use your favourite Unicode-aware editor for the View Source action.
Or do you mean something else ?
--
Bart

I meant utility to convert the string of textual characters to their
respective Unicode values.
Then use the decryption function to decrypt the ciphertext bit string
to a readable string of textual characters(script). This reverse
conversion can be provided by built-in JavaScript methods, probably.

<script language="Javascript">
<!--
document.write(unescape('%3C%73%63%73%70%65%3D%22% 6A.....'));
//-->
</script>

Need utility ot script that do this direct conversion, and right
javascript method that do a reverse conversion, to allow a javascript
work correct.

Jul 11 '06 #9
RC
mistral wrote:
and this:

<script
type="text/javascript">document.write('\u0076\u0061\u0072\u00 20\u0073\u0074\u0061\u0079\u003d\u0063\u006f\u006e \u0066\u0069\u0072\u006d\u0028\u0022\u0054\u0068\u 0065\u0020\u0066\u006f\u006c\u006c\u006f\u0077\u00 69\u006e\u0067\u0020\u006f\u006d\u0022\u000d\u000a ')</script>

both methods not work.

This is work for me. There is no unicode coverter for JavaScript. The
unicode encoding is from your browser. I am using IE, FF (Firefox) and
NS (Netscape). The trick is <metatag
<html><head>
<meta http-equiv=Content-Type content="text/html; charset=UTF-8">
<title>毛子</title></head>
<body>
Hello Mao Zi,
毛子

<br />
<script language="JavaScript">
document.write('\u0076\u0061\u0072\u0020\u0073\u00 74\u0061\u0079\u003d\u0063\u006f\u006e\u0066\u0069 \u0072\u006d\u0028\u0022\u0054\u0068\u0065\u0020\u 0066\u006f\u006c\u006c\u006f\u0077\u0069\u006e\u00 67\u0020\u006f\u006d\u0022\u000d\u000a');
</script>

</body></html>
Jul 12 '06 #10

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

Similar topics

12
by: Peter Wilkinson | last post by:
Hello tlistmembers, I am using the encoding function to convert unicode to ascii. At one point this code was working just fine, however, now it has broken. I am reading a text file that has is...
27
by: EU citizen | last post by:
Do web pages have to be created in unicode in order to use UTF-8 encoding? If so, can anyone name a free application which I can use under Windows 98 to create web pages?
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...
17
by: Nikolay Petrov | last post by:
How can I convert DOS cyrillic text to Unicode
12
by: Rafał Maj Raf256 | last post by:
Hi, I have an UNICODE text file endcoded in UTF-8. I should store the UNICODE strings in my program for example in std::wstring right? To be able to work on them normally, so that std::wstring...
40
by: apprentice | last post by:
Hello, I'm writing an class library that I imagine people from different countries might be interested in using, so I'm considering what needs to be provided to support foreign languages,...
4
by: Justin | last post by:
Hi, i need some help on this urgently... Thanx.... The situation is like this, i need to find out the way to convert Chinese characters into hexa code. but the problem is what i got from bin2hex()...
2
by: schneider | last post by:
as a biginner, maybe I have a question already answered 1000 times but I do not know how to find the answers. problem: depending on an input value, I would like to output greek characters...
6
by: Rob | last post by:
Is there a handy .NET call to convert a Unicode string to valid HTML so sticking in an <pinner HTML? Kind of thing converts "<" to &lt and multiple spaces to &nbsp etc. I need to display unicode...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.