25 lines
608 B
C++
25 lines
608 B
C++
#include <oniguruma.h>
|
|
#include <stdio.h>
|
|
|
|
int main(int argc, char * argv[])
|
|
{
|
|
static OnigEncoding encodings[] = {
|
|
ONIG_ENCODING_ASCII,
|
|
ONIG_ENCODING_UTF8,
|
|
ONIG_ENCODING_UTF16_BE,
|
|
ONIG_ENCODING_UTF16_LE,
|
|
ONIG_ENCODING_UTF32_BE,
|
|
ONIG_ENCODING_UTF32_LE,
|
|
};
|
|
int rc = onig_initialize(encodings, sizeof(encodings) / sizeof(encodings[0]));
|
|
if (rc != ONIG_NORMAL)
|
|
{
|
|
OnigUChar s[ONIG_MAX_ERROR_MESSAGE_LEN];
|
|
onig_error_code_to_str(s, rc, nullptr);
|
|
fprintf(stderr, "Error: %s\n", s);
|
|
return 1;
|
|
}
|
|
|
|
return 0;
|
|
}
|