函数:fromgbk GBK 转 UTF8(仅支持 iOS)

函数名称:GBK 转 UTF8

函数功能:转码,GBK 转 UTF8

引擎版本:iOS v2.2.6 以上

函数方法

str2 = str1:fromgbk()

参数 类型 必填 说明
str1 string 需要转换的 GBK 内容
返回值 类型 说明
str2 string 转换后的 UTF8 内容

函数用例

将字符串从 GBK 编码转换到 UTF8 编码

require "ts"
f = io.open("/var/mobile/Media/TouchSprite/lua/a.txt", "r")
s = f:read("*a")
f:close()
dialog(s:fromgbk(),5)
Copyright 北京帮你玩科技有限公司 2023 all right reserved,powered by Gitbook该文章修订时间: 2024-03-06 17:50:18

results matching ""

    No results matching ""