Jerry_Pang
asked on
Ascii to unicode
<script type="text/javascript">
Function ascii2unicode(text)
{
unicode= text
return unicode
}
</script>
=)
i want to convert the text to \u???? characters. (A points)
if thats possible. or replace any characters > 127 to "?"(B points) - (assited)
Having problem with unicode characters submmiting to my active x on a different language setings.
i figured i will need a javascript program that will convert any chinese/ñ special characters (ascii >127) to a ? character or convert it to a unicode text then my active x is good to go..
thanx. need info how
Function ascii2unicode(text)
{
unicode= text
return unicode
}
</script>
=)
i want to convert the text to \u???? characters. (A points)
if thats possible. or replace any characters > 127 to "?"(B points) - (assited)
Having problem with unicode characters submmiting to my active x on a different language setings.
i figured i will need a javascript program that will convert any chinese/ñ special characters (ascii >127) to a ? character or convert it to a unicode text then my active x is good to go..
thanx. need info how
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanx. just posting it here for my history questions.
function hexVal(char){
decNum=char.charCodeAt(0)
if ( decNum>127 ){
hex=decNum.toString(10).to
switch (hex.length){
case 2:hex='&#'+'00'+hex + ';'
return hex
case 3:hex='&#'+'0'+hex + ';'
return hex
default :
return '&#'+hex + ';'
}
}
else
return char
}