https://github.com/asmod4n/mruby-string-is-utf8
Checks if a string is valid utf8
https://github.com/asmod4n/mruby-string-is-utf8
mruby
Last synced: 4 days ago
JSON representation
Checks if a string is valid utf8
- Host: GitHub
- URL: https://github.com/asmod4n/mruby-string-is-utf8
- Owner: Asmod4n
- License: other
- Created: 2016-06-11T10:57:57.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2026-03-01T11:11:29.000Z (3 months ago)
- Last Synced: 2026-03-01T14:55:07.310Z (3 months ago)
- Topics: mruby
- Language: C++
- Homepage:
- Size: 405 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mruby-string-is-utf8
Checks if a string is valid utf8
Ruby Example
============
```ruby
"hallo".is_utf8? # returns true or false
"hallo".is_utf8_raw # returns 0 if true or the position where a offending char is found
```
C Example
=========
```c
#include
mrb_value str = mrb_str_new_lit(mrb, "hallo");
mrb_str_is_utf8(str); // returns TRUE or FALSE
mrb_str_is_utf8_raw(str); // returns 0 if true or the position where a offending char is found
```
Acknowledgements
================
This is using the single header version of simdutf from https://github.com/simdutf/simdutf