在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
iptables 例如 你好 的unicode编码为 044F60597D 原理和如何编程实现转换? --------------------------------------------------------------- 其实你只要把你的字符串转化为widestring类型就可以了. Type Maximum length Memory required Used for ShortString 255 characters 2 to 256 bytes backward compatibility AnsiString ~2^31 characters 4 bytes to 2GB 8-bit (ANSI) characters WideString ~2^30 characters 4 bytes to 2GB Unicode characters; --------------------------------------------------------------- var WS: WideString; WC: WideChar; Code: Word; begin WS := '你好'; WC := WS[1]; Move(WC, Code, SizeOf(WC)); ShowMessage(IntToHex(Code, 2)); WC := WS[2]; Move(WC, Code, SizeOf(WC)); ShowMessage(IntToHex(Code, 2)); end; var I: Integer; WS: WideString; Code: Word; Codes: String; begin WS := '你好'; Codes := '0x'; for I := 1 to Length(WS) do begin Move(WS[I], Code, SizeOf(Code)); Codes := Codes + IntToHex(Code, 2); end; ShowMessage(Codes); end; |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论