duncanc / icu4lua Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I'm trying to port it over at https://gitlab.com/raingloom/icu4lua/ but I'm having trouble with the linker.
Any chance of getting this packaged for LuaRocks?
Inside: static int icu_utf8_char(lua_State *L)
at:
Line 368 in 7b37d34
the test is incorrect:
else if (codePoint > 0x110000) {
return luaL_argerror(L,i+1,"invalid codepoint");
}
else {
// 00000000 000zzzzz yyyyyyyy xxxxxxxx
// 11110zzz 10zzyyyy 10yyyyxx 10xxxxxx
...
It seems you have reversed the original test that was
else if (codePoint < 0x110000) {
// 00000000 000zzzzz yyyyyyyy xxxxxxxx
// 11110zzz 10zzyyyy 10yyyyxx 10xxxxxx
...
}
else {
return luaL_argerror(L,i+1,"invalid codepoint");
}
But you forgot the equal sign! So the code point 0x110000 is accepted as if it was valid and will generate a non-standard UTF-8 sequence (0xF8,0x80,0x80,0x80): the bytes 0xC0, 0xC1, and 0xF8 to 0xFF are NEVER part of any valid UTF-8 text.
Hello, @duncanc
We would like to use icu4lua in our project. Though we need versions to be declared explicitly for 3rd-party libraries.
Would you mind adding version tag for at least last commit?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.