从 SQLite 数据库中获取 Unicode 文本
Get Unicode Text from SQLite DB
我有一个 SQLite 数据库,其中包含带有 ü、é 等奇怪字符的值。默认情况下,SQLite 是 UTF8,这些值在数据库工具中看起来不错。
现在我需要用这些值填充 Livecode 中的选项菜单。
当我做
put uniencode ("Krüger", "utf8") into tData
set the text of button "option" to tDAta
我在选项按钮中得到了正确的值,但看起来很奇怪,像 "K r ü g e r"
而不是 "Krüger"
这样的大间距
编辑:文本似乎显示在 "full width" 中。我正在使用 Tahoma,但更改字体并没有什么不同。
如果我不执行 uniencode,我会得到 "Krüger"
。
我也试过 set the unicodetext of button "option" to tData
但那给了我一行中文或日文字符左右。
我的错误在哪里?
我正在使用 Livecode 7.0.6。
put textDecode(MyVariable,”UTF8”) into NewVariable
从 LiveCode 7 开始,uniencode 和 unidecode 函数已弃用。在您的示例中,尝试:
put revDataFromQuery(,, tConnectionId, tQuery) into tUTF8data
set the text of button "option" to textDecode(tUTF8data,"utf8")
我有一个 SQLite 数据库,其中包含带有 ü、é 等奇怪字符的值。默认情况下,SQLite 是 UTF8,这些值在数据库工具中看起来不错。
现在我需要用这些值填充 Livecode 中的选项菜单。 当我做
put uniencode ("Krüger", "utf8") into tData
set the text of button "option" to tDAta
我在选项按钮中得到了正确的值,但看起来很奇怪,像 "K r ü g e r"
而不是 "Krüger"
这样的大间距
编辑:文本似乎显示在 "full width" 中。我正在使用 Tahoma,但更改字体并没有什么不同。
如果我不执行 uniencode,我会得到 "Krüger"
。
我也试过 set the unicodetext of button "option" to tData
但那给了我一行中文或日文字符左右。
我的错误在哪里?
我正在使用 Livecode 7.0.6。
put textDecode(MyVariable,”UTF8”) into NewVariable
从 LiveCode 7 开始,uniencode 和 unidecode 函数已弃用。在您的示例中,尝试:
put revDataFromQuery(,, tConnectionId, tQuery) into tUTF8data
set the text of button "option" to textDecode(tUTF8data,"utf8")