Giter VIP home page Giter VIP logo

Comments (5)

filmil avatar filmil commented on June 13, 2024

What error are you getting, and could you provide a repro test?

The output capacity you linked to is not hard coded; rather it's the capacity of the initial buffer - the idea is if the initial buffer is not overflowed that we don't need to redo the call. But if it overflows, we repeat the call using the needed buffer size that was discovered during preflight.

See here: https://docs.rs/rust_icu_ustring/latest/src/rust_icu_ustring/lib.rs.html#86

from rust_icu.

hsivonen avatar hsivonen commented on June 13, 2024

Here's the repro (67 Hangul syllables that decompose to 3 jamo each, i.e. 201 jamo):

use rust_icu_ustring::UChar;
use rust_icu_unorm2::UNormalizer;

fn main() {
    let s = "탐탐퀀탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐탐";
    let u = UChar::try_from(s).unwrap();
    let normalizer = UNormalizer::new_nfd().unwrap();
    normalizer.normalize_ustring(&u).unwrap();
}

The failure with rust_icu 2.0.2 and system ICU from Ubuntu 20.04 is (but I first saw this with rust_icu trunk and ICU4C nearly-current trunk):
thread 'main' panicked at 'assertion failed: common::Error::is_ok(status)', /home/hsivonen/.cargo/registry/src/github.com-1ecc6299db9ec823/rust_icu_unorm2-2.0.2/src/lib.rs:97:9

from rust_icu.

filmil avatar filmil commented on June 13, 2024

Here's the repro (67 Hangul syllables that decompose to 3 jamo each, i.e. 201 jamo):

Thank you I have a fix.

from rust_icu.

filmil avatar filmil commented on June 13, 2024

@hsivonen you can now try 2.0.3 and see if it works for you.

Thank you for your patience.

from rust_icu.

hsivonen avatar hsivonen commented on June 13, 2024

Thanks. My test case now passes.

from rust_icu.

Related Issues (20)

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.