Merge pull request #122 from polserver/unicode-lower-upper-fixes

Add UTF8 checks to String toLower/toUpper
This commit is contained in:
turleypol 2020-01-20 20:46:47 +01:00 committed by GitHub
commit 7bb27f7198
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 1 deletions

View file

@ -2,9 +2,14 @@
<ESCRIPT>
<header>
<topic>Latest Core Changes</topic>
<datemodified>01-18-2020</datemodified>
<datemodified>01-20-2020</datemodified>
</header>
<version name="POL100">
<entry>
<date>01-20-2020</date>
<author>Kevin:</author>
<change type="Fixed">Huge Performance loss in Lower/Upper String functions.</change>
</entry>
<entry>
<date>01-18-2020</date>
<author>DevGIB:</author>

View file

@ -404,6 +404,11 @@ std::vector<wchar_t> convertutf8( const std::string& value )
void String::toUpper()
{
if ( !hasUTF8Characters() )
{
Clib::mkupperASCII( value_ );
return;
}
#ifndef WINDOWS
std::vector<wchar_t> codes = convertutf8<wchar_t>( value_ );
value_.clear();
@ -438,6 +443,11 @@ void String::toUpper()
void String::toLower()
{
if ( !hasUTF8Characters() )
{
Clib::mklowerASCII( value_ );
return;
}
#ifndef WINDOWS
std::vector<wchar_t> codes = convertutf8<wchar_t>( value_ );
value_.clear();

View file

@ -1,4 +1,6 @@
-- POL100 --
01-20-2020 Kevin:
Fixed: Huge Performance loss in Lower/Upper String functions.
01-18-2020 DevGIB:
Changed: Return type of XMLFile method .appendxmlnode() now returns the created node on success.
Changed: Return type of XMLNode method .appendxmlnode() now returns the created node on success.