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