Suggestion: some changes in String API

Tsuda Kageyu tsuda.kageyu at
Fri May 24 04:07:38 UTC 2013

I see your point that we should take into account the users who are not 
using the STL strings. If so, I think that we need the wide char version 
of toCString() as well, especially for Windows users. For example:

  const wchar_t *toWCString() const;

About which encoding is good to be the default, I need more opinions 
from the perspective of *nix users. I'm not familiar with Unix like 
systems enough to determine it.


>Not everybody using C++ uses std:string so I'd prefer if you keep toCString
>Perhaps one thing to consider is whether UTF-8 conversion should be the
>default instead of Latin1.
>On Thu, May 23, 2013 at 1:32 PM, Tsuda Kageyu <tsuda.kageyu at>wrote:
>> I suggest to make some small changes in String API.
>> Currently, String class has some methods which convert itself into a
>> standard C/C++ string, but they are somewhat confusing and inconsistent.
>> So I'd like to change these methods like this:
>> // Current
>> std::string to8Bit(bool unicode = false) const;
>> const std::wstring &toWString() const;
>> const char *toCString(bool unicode = false) const;
>> // New
>> std::string toStdString(Type t = Latin1) const;
>> const std::wstring &toStdWString() const;
>> const char *toCString(String::Type t = Latin1) const;
>> The actual code is at
>> I think that toCString() is no longer needed and can be substituted by
>> toStdString() so we can remove it.
>> _______________________________________________
>> taglib-devel mailing list
>> taglib-devel at
>---html-part included links-------
>mailto:tsuda.kageyu at
>mailto:taglib-devel at
>taglib-devel mailing list
>taglib-devel at

More information about the taglib-devel mailing list