Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1227 How can I encode a character string into its hexadecimal ASCII representation?

irt.org | Knowledge Base | JavaScript | Text | Q1227 [ previous next ]

Q1227 How can I encode a character string into its hexadecimal ASCII representation?

Try:

<script language="JavaScript"><!--
var text1 = 'a?bc4*';
var text2='';

for (i=0;i<text1.length;i++)
    text2 += text1.charCodeAt(i).toString(16);

alert(text2);
//--></script>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.