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: about 1 year ago
JSON representation
Checks if a string is valid utf8
- Host: GitHub
- URL: https://github.com/asmod4n/mruby-string-is-utf8
- Owner: Asmod4n
- License: bsd-2-clause
- Created: 2016-06-11T10:57:57.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-04-14T11:12:27.000Z (almost 9 years ago)
- Last Synced: 2025-01-11T18:47:27.515Z (about 1 year ago)
- Topics: mruby
- Language: C
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 3
- 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
```