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: 6 months 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 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-14T11:12:27.000Z (about 8 years ago)
- Last Synced: 2024-11-12T17:48:58.570Z (6 months 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
- awesome-mruby - mruby-string-is-utf8 - checks if a string is valid utf8. (Utilities)
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
```