Comments (5)
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.
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.
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.
@hsivonen you can now try 2.0.3 and see if it works for you.
Thank you for your patience.
from rust_icu.
Thanks. My test case now passes.
from rust_icu.
Related Issues (20)
- Start using the stable rust toolchain instead of nightly HOT 1
- Feature for static linking build HOT 3
- Character set conversion support (`ucnv.h`) HOT 2
- Building on FreeBSD: icu-config vs. pkg-config HOT 2
- Problem with versioned functions (FreeBSD) HOT 10
- Add a `LICENSE` file to every crate in this project
- Update rust_icu to support ICU 71.1
- Support UCPTrie and UMutableCPTrie HOT 5
- Better support for &[u16]
- Add a builder that tests `rust_icu` with the "future" release of ICU
- Add support for ICU 72.1
- Remove the mentions of now unsupported ICU versions
- Expose a few interesting symbols in rust_icu_sys HOT 1
- Does not build in OpenSuSe when versioned_function is used HOT 3
- SOLVED - Error building on macOS HOT 1
- Upgrade to ICU 73.1 HOT 1
- Update bindgen version HOT 2
- `make static-bindgen` failed HOT 8
- Upgrade the build environment to use rust 1.71.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust_icu.