代理中将转化unicode串转化成汉字串的例子

来源:互联网 发布:sql server select 编辑:程序博客网 时间:2024/05/16 22:41
用javascript将汉字转化成unicode例子
s=new String(loginuser);
 newuser="";
 for(i=0;i<s.length;i++)
  {
   newuser=newuser+s.charCodeAt(i)+";";
  }

代理中将转化unicode串转化成汉字串的例子

Call UnicodeToString(unicodestr,转化的汉字串)

Sub UnicodeToString(unicodes As String,anystring As String)  
 If unicodes=""  Then
  anystring=""
  Exit Sub
 End If
 
 While Not unicodes=""
  tmpcode$=Left$(unicodes,Instr(unicodes,";")-1)
  unicodes=Right$(unicodes,Len(unicodes)-Instr(unicodes,";"))
  
  If tmpcode$="65536" Then
   anystring=""
   Exit Sub
  End If
  anystring=Trim(anystring)+Uchr$(Cstr(tmpcode$))
 Wend
 
End Sub