Commit Graph

17 Commits

Author SHA1 Message Date
Vadim Zeitlin
bfb893170e Fix initialization of SingleCharBuffer and Utf16CharBuffer data
Don't do it at all in the ctor, initializing just the first element of
the array is useless as it's overwritten by EncodeChar() anyhow, so just
leave the task of NUL-terminating the data to this function as well.

It might be even better to just have a ctor taking wxUniChar in these
classes instead and make EncodeChar() a trivial wrapper around it, but
for now just apply the minimal fix to repair the test breakage after the
last commit.

See https://github.com/wxWidgets/wxWidgets/pull/467#issuecomment-310384946
2017-06-22 15:55:24 +02:00
Vadim Zeitlin
4d3aaafc86 Avoid MSVC warning about correctly default-initializing arrays
Don't rely on default array initialization, not only it may not work
with some really old compilers (which is actually not that important as
we don't seem to rely on these arrays being initialized, in fact), but
it results in warnings about working correctly (sic) from MSVC in
versions from 9 up to 12 inclusive.

See https://github.com/wxWidgets/wxWidgets/pull/467#issuecomment-310193867
2017-06-22 01:50:19 +02:00
Vadim Zeitlin
24f3ff3b78 No changes, just fix a typo in a recently added comment 2017-06-21 19:07:13 +02:00
ARATA Mizuki
58d940690a Better handling of supplementary wxUniChar values in some of wxString methods
On MSW, the Unicode code point is now properly encoded as UTF-16 when
assigned or appended to a wxString.

Closes #11827
2017-05-01 18:37:59 +09:00
Václav Slavík
128c13c149 Remove assert from wxStringOperationsUtf8::DecIter().
The assert prevented decrementing end() iterator, which is a valid
operation.

Fixes #15566.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74976 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-10-09 10:45:43 +00:00
Vadim Zeitlin
3f66f6a5b3 Remove all lines containing cvs/svn "$Id$" keyword.
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.

If nothing else, this will make an eventual transition to Git simpler.

Closes #14487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-26 16:02:46 +00:00
Vadim Zeitlin
5b119b8b2e make wxStringOperationsWchar methods templates too to be able to reuse them with char pointers (and for consistency with wxStringOperationsUtf8)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59795 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-23 23:11:55 +00:00
Vadim Zeitlin
657a8a3598 first round of debug/release merge: introduce wxDEBUG_LEVEL, for now defined as 1 if __WXDEBUG__ is defined, i.e. no real changes; don't use __WXDEBUG__ in the headers to keep debug and release builds ABI-compatible; add functions to customize or disable asserts handling
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59711 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-21 23:36:37 +00:00
Vadim Zeitlin
b5343e065a only provide ptrdiff_t versions of verious operator+/- working with iterators instead of overloads for both int and size_t: this seems to be enough and the existing overloads were not enough for 64 bit builds where expressions such as iter+(ptr2-ptr1) didn't compile without extra casts
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51053 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-01-06 22:27:01 +00:00
Václav Slavík
1774c3c535 made UTF-8 tables const
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48322 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-08-22 09:30:40 +00:00
Václav Slavík
ac2d749e88 optimize wxStringOperationsUtf8::DecodeChar() for the ASCII case
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48321 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-08-22 09:24:56 +00:00
Václav Slavík
1fc10687bf added wxUniChar::AsUTF8() for easy conversion in UTF8 build
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46376 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-06-08 20:17:34 +00:00
Václav Slavík
bfb6847df6 compilation fix for STL implementations that use (const) char* for std::string iterators
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46002 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-05-13 00:17:32 +00:00
Václav Slavík
111d99489d added code for optimized handling of UTF-8 locales: some string operations are more efficient under it and it's possible to completely compile-out support for other locales if the target system is known to only use UTF-8 locales
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45782 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-05-03 11:05:04 +00:00
Václav Slavík
04d29fda82 added missing #include "wx/buffer.h"
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45704 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-04-28 07:56:45 +00:00
Václav Slavík
2523e9b700 use UTF8-encoded char* strings in UTF8 build instead of wchar_t* if the current locale uses UTF8;
fall back to widechar CRT functions in the locale is not UTF8


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45663 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-04-26 11:40:04 +00:00
Václav Slavík
467175ab3f moved primitive string and string iterators operations to stringops.h/cpp files to make wxString code easier to read
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45533 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-04-19 10:05:55 +00:00