本文整理自网络,侵删。
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
相关阅读 >>
pchar和array [0..255] of char的区别
Delphi10.3构造一个json数据的第三种方法,并格式化输出
Delphi sendmessage postmessage 原理和区别
Delphi messagebox 和 messagedlg用法
更多相关阅读请进入《Delphi》频道 >>