← Back to team overview

kicad-developers team mailing list archive

Re: 6.0 string proposal

 

On Tue, Apr 30, 2019 at 08:59:46AM -0400, Wayne Stambaugh wrote:
> Given that std::wstring is platform dependent, I would be opposed to
> using it.  I'm not opposed to std::u32string but UTF8 is pretty well
> vetted so please keep that in mind.  I think the possibility of breakage
> is low but I'm not naive enough to think that it's zero.  You would have
> to do some serious testing to ensure the conversion of std::u32string to
> and from UTF8 isn't broken before I would be comfortable merging it into
> master.
> 
> Wayne
> 
These are just thoughts of a stranger.

Why not to use std::string to keep a byte array which represents a UTF-8
string itself? Size of the string means its length in bytes and
utf8::distance() [1] returns a number of the code points, i.e.
length in symbols.

[1] http://utfcpp.sourceforge.net/

Regards,
Dmitry


Follow ups

References