summaryrefslogtreecommitdiff
path: root/sample/names.c
diff options
context:
space:
mode:
Diffstat (limited to 'sample/names.c')
-rw-r--r--sample/names.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sample/names.c b/sample/names.c
index 6667eb5..2cf3a2f 100644
--- a/sample/names.c
+++ b/sample/names.c
@@ -35,6 +35,9 @@ extern int main(int argc, char* argv[])
static UChar* pattern = (UChar* )"(?<foo>a*)(?<bar>b*)(?<foo>c*)";
static UChar* str = (UChar* )"aaabbbbcc";
+ OnigEncoding use_encs[] = { ONIG_ENCODING_ASCII };
+ onig_initialize(use_encs, sizeof(use_encs)/sizeof(use_encs[0]));
+
r = onig_new(&reg, pattern, pattern + strlen((char* )pattern),
ONIG_OPTION_DEFAULT, ONIG_ENCODING_ASCII, ONIG_SYNTAX_DEFAULT, &einfo);
if (r != ONIG_NORMAL) {