the historical reason is that std::string is part of the C++
standard
library, and implementations of that generally only started to
become
actually usable on all platforms in the early 2000s.
Okay, that shouldn't be an real argument, when we're talking about
refactoring anyways ;-)
the other reason is that std::string isn't particularly well suited
to
storing Unicode, because all of the operations on it are defined in
terms of elements of an array. so when using std::string accessing
UTF-8 characters is both cumbersome and error-prone, while using
std::wstring is not an option at all because it is based on
wchar_t,
and
the geniuses didn't define whether that is 16bit or 32bit, so it's
_completely_ useless in practice. the only option really would be
to
use something like std;:basic_string<uint32_t>, but that wastes a
lot
of
space in the common case, or std::basic_string<uint16_t>, which is
just
as stupid as our existing rtl::OUString.
hmm, already guessed that ;-o
Wouldn't this call for an extension of std::string (derived class)
or an generic helper class ?
Does anyone know whether libraries like boost have a good
solution for that ?
cu
--
Mit freundlichen Grüßen / Kind regards
Enrico Weigelt
VNC - Virtual Network Consult GmbH
Development
Äußere Bayreuther Str. 55, D - 90409 Nürnberg
Tel: +49 911 72303-30
Fax: +49 911 72303-50
enrico.weigelt@vnc.biz; www.vnc.de
Context
- Re: About Strings · Enrico Weigelt
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.