1 function ToDBC(str){
2 var result = '';
3 for(var i=0; i < str.length; i++){
4 code = str.charCodeAt(i);
5 if(code >= 33 && code <= 126){
6 result += String.fromCharCode(str.charCodeAt(i) + 65248);
7 }else if (code == 32){
8 result += String.fromCharCode(str.charCodeAt(i) + 12288 - 32);
9 }else{
10 result += str.charAt(i);
11 }
12 }
13 return result;
14 }