473,395 Members | 1,720 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,395 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 22819
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...
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
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.