-
-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Utf8 printing support #27
Conversation
Changes to be committed: modified: src/ltui/label.lua modified: src/ltui/textedit.lua
Changes to be committed: modified: src/ltui/label.lua modified: src/ltui/textedit.lua
Changes to be committed: modified: src/ltui/textedit.lua
Changes to be committed: modified: src/ltui/textedit.lua
Oh, it's great. I will test it in these days. BTW, can you help me add a simple test example with utf8 characters in tests directory? Thanks. |
line = line:sub(width + 1) | ||
local size = 0 | ||
for i = 1, #line do | ||
if (line:byte(i) & 0xc0) ~= 0x80 then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, It does not work on luajit. We need bit module. bit.band(a, b)
self:text_set(text:sub(1, #text - 1)) | ||
local size = 1 | ||
-- while continuation byte | ||
while (text:byte(#text - size + 1) & 0xc0) == 0x80 do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here
Adds utf8 printing and input support
it will not affect ascii implementations