An open API service indexing awesome lists of open source software.

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

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
```