pcre: encoding needs to be set to utf8
							parent
							
								
									8193dc2891
								
							
						
					
					
						commit
						a7648bb5a8
					
				|  | @ -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" } } ] | ||||
| [ | ||||
|  |  | |||
|  | @ -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 ; | ||||
|  |  | |||
|  | @ -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 ) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue