pcre: encoding needs to be set to utf8

db4
Björn Lindqvist 2013-10-25 17:40:37 +02:00 committed by John Benediktsson
parent 8193dc2891
commit a7648bb5a8
3 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,4 @@
USING: accessors pcre pcre.info sequences tools.test ;
USING: accessors pcre pcre.info pcre.utils sequences tools.test ;
[ { { 3 "day" } { 2 "month" } { 1 "year" } } ]
[

View File

@ -2,6 +2,7 @@ USING:
accessors
alien alien.accessors alien.c-types alien.data alien.strings
arrays
io.encodings.utf8
kernel
math
pcre.ffi pcre.utils
@ -22,7 +23,7 @@ IN: pcre.info
PCRE_INFO_NAMEENTRYSIZE fullinfo ;
: name-table-entry ( addr -- group-index group-name )
[ <alien> 1 alien-unsigned-1 ] [ 2 + <alien> alien>native-string ] bi ;
[ <alien> 1 alien-unsigned-1 ] [ 2 + <alien> utf8 alien>string ] bi ;
: options ( pcre -- opts )
f PCRE_INFO_OPTIONS fullinfo ;

View File

@ -72,7 +72,7 @@ TUPLE: matcher pcre extra subject ofs exec-opts match ;
: parse-match ( subject nametable match-data -- match )
swapd first2 swap [ substring-list ] keep void* <c-direct-array>
[ alien>native-string ] { } map-as [ of swap 2array ] with map-index ;
[ utf8 alien>string ] { } map-as [ of swap 2array ] with map-index ;
! High-level
: <compiled-pcre> ( expr -- compiled-pcre )