Jump to content
Sign in to follow this  
asp

Vbscripts: Character To Hex Conversion

Recommended Posts

Ini ada contoh chinese character..

dan telah diconvertkan guna javascript

Chinese character = ½÷谨

Decimal Value= 35880

ni code javascripts nye:

/*

convertToEntities()

This is to convert Chinese characters to Unicode numbers

*/

function convertToEntities() {

var tstr = document.form.unicode.value;

var bstr = '';

for(i=0; i<tstr.length; i++)

{

if(tstr.charCodeAt(i)>127)

{

bstr += 'tstr.charCodeAt(i) + ';';

}

else

{

bstr += tstr.charAt(i);

}

}

document.form.entity.value = bstr;

}

MASALAH NYER:

ADA TAK DALAM VBSCRIPT FUNCTION NAK CARI VALUE DECIMAL TU?

Wassalam..

Share this post


Link to post
Share on other sites

kalau tak nampak chinese character tu, tukar setting Browser

right click --> Encoding--> cari Traditional Chinese Big5

nanti nampak

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...