Comments (4)
I'd see it more like C++ defined for std::from_chars
--- struct has a pointer and error code. However, if we want to finally C API and binding to other languages, maybe your idea with plain-old-data is more suitable.
from simdutf.
@WojciechMula Alternatively, you can replace the Boolean with an error code (could be an integer type). Then you want to flip the convention around and have it be error
with 0
being ok
and any non-zero value representing an error code. It allows you to provide fine error reporting. So...
struct result {
int error;
size_t length;
}
but if we are just going to report yes or no, then such an API is a waste of effort and we should go with something simpler.
from simdutf.
cc @clausecker
from simdutf.
@NicolasJiaxin This is something you could work on... The scenario of the validation functions is relatively simple. Of course, there are many different design decisions about how to proceed. Benchmarking could help.
from simdutf.
Related Issues (20)
- add support for punycode HOT 2
- Assembler issues on old machines HOT 1
- Incorrect #define for icelake HOT 2
- Slow performance compared to v8 String::NewFromUtf8 HOT 8
- Add SVE support HOT 3
- Feature request: UTF8 Byte Length HOT 6
- Split out `simdutf::validate_utf8()` HOT 3
- Add support for Big Endian systems HOT 3
- Add support for WebAssembly SIMD128 HOT 2
- For short strings `convert_utf8_to_utf16le_with_errors` may sometimes cause buffer overflows by reading before the buffer when the input is not UTF-8 HOT 8
- Add Windows on ARM support HOT 3
- v3.2.1 build failure on arm64 macOS HOT 2
- Single-header version requires two files to be included HOT 7
- Compiling with clang on windows fails HOT 1
- Detect best implementation at compile time HOT 2
- `convert_valid_utf16_to_utf8` produces incorrect result HOT 1
- Excessive check for CLMUL on "Westmere" path HOT 8
- SIGILL on convert_utf8_to_utf16le HOT 26
- Implement latin 1 to UTF-8 "length" functions
- Compiler warning (level 2) C4146 with VS 2022 latest version HOT 3
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 simdutf.