如何实现lua字符串转换为大写而不处理重音字符的长尾词方法?
- 内容介绍
- 文章标签
- 相关推荐
本文共计196个文字,预计阅读时间需要1分钟。
我在尝试将一些法语文本转换成Lua中的大写字母,但不会转换成重音符号。知道为什么吗?
测试脚本:print('échelle')print(string.upper('échelle'))print('éCHELLE')print(string.lower('éCHE'))
我正在尝试将一些法语文本转换为lua中的大写字母,它不会转换重音字符.知道为什么吗?测试脚本:
print(‘échelle’)
print(string.upper(‘échelle’))
print(‘ÉCHELLE’)
print(string.lower(‘ÉCHELLE’))
输出:
它可能有点矫枉过正,但你可以用 slnunicode(LuaRocks中可用)来做到这一点.échelle
éCHELLE
ÉCHELLE
Échelle
require "unicode" print(unicode.utf8.upper("échelle")) -- ÉCHELLE
您可能需要使用unicode.ascii.upper或unicode.latin1.upper,具体取决于源文件的编码.
本文共计196个文字,预计阅读时间需要1分钟。
我在尝试将一些法语文本转换成Lua中的大写字母,但不会转换成重音符号。知道为什么吗?
测试脚本:print('échelle')print(string.upper('échelle'))print('éCHELLE')print(string.lower('éCHE'))
我正在尝试将一些法语文本转换为lua中的大写字母,它不会转换重音字符.知道为什么吗?测试脚本:
print(‘échelle’)
print(string.upper(‘échelle’))
print(‘ÉCHELLE’)
print(string.lower(‘ÉCHELLE’))
输出:
它可能有点矫枉过正,但你可以用 slnunicode(LuaRocks中可用)来做到这一点.échelle
éCHELLE
ÉCHELLE
Échelle
require "unicode" print(unicode.utf8.upper("échelle")) -- ÉCHELLE
您可能需要使用unicode.ascii.upper或unicode.latin1.upper,具体取决于源文件的编码.

