Delphi uniGUI中Cookies使用中文汉字的方法


本文整理自网络,侵删。

 
uniGUI中Cookies使用中文汉字的方法


在目前的UniGUI(ver:0.88)中使用UniApplication.Cookies.SetCookie来设置一个中文的Cookies时,然后用UniApplication.Cookies.Values来读取Coolies值时,中文会变成乱码。查询UniGui论坛,得到以下解决方法:

procedure TMainForm.UniButton1Click(Sender: TObject);
var
  username:string;
begin
   UniApplication.Cookies.SetCookie('name',EncodeString('中文汉字')); //使用 EncodeString函数编码
   username :=  DecodeString(UniApplication.Cookies.Values['name']);  //使用 DecodeString解码

来源:https://blog.csdn.net/shuiying/article/details/7492367

相关阅读 >>

Delphi firedac 另存json

Delphi xe5 json

Delphi (user agent) of a twebbrowser

Delphi 将svg加载到timage控件

Delphi rs232c接脚与对连线

Delphi 根据注册表信息判断程序是否安装

Delphi判断文本文件的编码格式

Delphi 分离网址链接最后一层文件目录

Delphi map file

Delphi 为当前窗口客户区捉图: getformimage

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...