Giter Club home page Giter Club logo

icu4lua's People

Contributors

duncanc avatar ignacio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

icu4lua's Issues

in icu_utf8_char(): codepoint value 0x110000 is accepted, even if it generates invalid UTF-8

Inside: static int icu_utf8_char(lua_State *L)
at:

else if (codePoint > 0x110000) {

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.

No releases published

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.