Re: [pcre-dev] implementing support for std::wstring in pcre…

Top Page
Delete this message
Author: Thorsten Schöning
Date:  
To: pcre-dev
Subject: Re: [pcre-dev] implementing support for std::wstring in pcrecpp
Guten Tag Craig Silverstein,
am Donnerstag, 6. Januar 2011 um 17:51 schrieben Sie:

> I'm not sure I understand the latter point. Are you saying you want
> more conversions to automatically convert captured values back to
> std::wstring type?


Yes, if I put std::wstring in, I want to be able to get it back, or
UTF-8, depending on the data type supplied. But this is just sugar.

> This is all getting more complicated than I'd like this scheme to be.
> I'm definitely happier if you convert the input to utf8 before calling
> pcre, and converting the output from utf8 afterwards -- it seems
> like there less opportunity for trouble if pcre has a very clean
> encoding model.


std::wstring in and out would be as consistent and clean as supplying
std::string with/without UTF-8 and getting it back, in my opinion.
I would prefer this approach because pcrecpp already does this, but
just not for all datatypes it could support. Seems I need to think of
an own Wrapper and maybe subclass StringPiece and Co. I wouldn't want
to patch the official pcrecpp source more than necessary if there's no
chance to get my code merged.

Mit freundlichen Grüßen,

Thorsten Schöning

--
Thorsten Schöning
AM-SoFT IT-Systeme - Hameln | Potsdam | Leipzig

Telefon: Potsdam: 0331-743881-0
E-Mail:  tschoening@???
Web:     http://www.am-soft.de


AM-SoFT GmbH IT-Systeme, Konsumhof 1-5, 14482 Potsdam
Amtsgericht Potsdam HRB 21278 P, Geschäftsführer: Andreas Muchow