Re: Glib::Regex and unicode chars

On Sun, 2012-08-19 at 19:10 +0200, Jakub Okoński wrote:
> Hello,
> I'm trying to implement syntax highlighting and it works perfectly
> until I input some special chars, in which fetch_pos method gives me
> number of bytes rather than characters.

Yes, that's what its documented as doing:

I guess that is more helpful when you want to get a substring of a C
string or a std::string and we didn't think about it when wrapping it
for gtkmm. Maybe we should add a fetch_pos_chars() to be more suitable
for use with Glib::ustring::operator[], though it would probably be most
efficient if that was in GTK+ itself.

And there is already this method, though I guess it's not so efficient:
Glib::ustring fetch(const Glib::ustring& name);


Murray Cumming
murrayc murrayc com

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]