From 895d99fd68f7f4938e9feee68e75d8c896dbe0e0 Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Thu, 23 Feb 2006 22:30:23 +0000 Subject: [PATCH] bugfix: use utf8-aware substring function --- components/grafite_parser/grafiteWalker.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/grafite_parser/grafiteWalker.ml b/components/grafite_parser/grafiteWalker.ml index eb2eb22a5..742532113 100644 --- a/components/grafite_parser/grafiteWalker.ml +++ b/components/grafite_parser/grafiteWalker.ml @@ -51,7 +51,8 @@ let grep_statement ?(status = LexiconEngine.initial_status) ?(callback = ignore) | Some (status, stm) when test stm -> (* "interesting" statement *) let loc_begin, loc_end = HExtlib.loc_of_floc (get_loc stm) in let raw_statement = - String.sub content loc_begin (loc_end - loc_begin) in + Netconversion.ustring_sub `Enc_utf8 loc_begin (loc_end - loc_begin) + content in callback raw_statement; exaust (raw_statement :: acc) status | Some (status, _stm) -> exaust acc status in -- 2.39.2