initialize oniguruma
This commit is contained in:
parent
3048ea4639
commit
cf7fdec792
20
main.cc
20
main.cc
@ -1,5 +1,25 @@
|
|||||||
#include <oniguruma.h>
|
#include <oniguruma.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
int main(int argc, char * argv[])
|
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)
|
||||||
|
{
|
||||||
|
OnigErrorInfo einfo;
|
||||||
|
OnigUChar s[ONIG_MAX_ERROR_MESSAGE_LEN];
|
||||||
|
onig_error_code_to_str(s, rc, &einfo);
|
||||||
|
fprintf(stderr, "Error: %s\n", s);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user