Lua String.upper does not use stress characters?

I am trying to convert some French text to uppercase letters in lua, it will not convert accented characters. Do you know why?

Test script:

print(‘échelle’)
print(string.upper(‘échelle’))
print(‘ÉCHELLE’)
print(string.lower(‘ÉCHELLE’))

Output:

échelle
éCHELLE
ÉCHELLE
Échelle

It may be overkill, but you can do it with slnunicode (available in LuaRocks).

require "unicode"
print(unicode. utf8.upper("échelle"))
-- ÉCHELLE

You may need to use unicode.ascii.upper or unicode.latin1.upper, depending on the encoding of the source file.

I am trying to convert some French text to uppercase letters in lua, it will not convert accented characters. Any idea why?

Test script:

print(‘échelle’)
print(string.upper(‘échelle’))
print(‘ÉCHELLE’)
print(string.lower(‘ÉCHELLE’))

Output:

échelle
éCHELLE
ÉCHELLE
Échelle

It may be a bit overkill, but you can use slnunicode(LuaRocks Available in) to do this.

require "unicode"
print(unicode.utf8.upper("échelle"))
-- ÉCHELLE

You may need to use unicode.ascii.upper or unicode.latin1.upper, depending on the encoding of the source file.

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 3199 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.