9 Commits

Author SHA1 Message Date
Jonathan Phénix
7d5405cea5 COMMON: Fix build warning with LLVM's scan-build 2020-12-22 01:49:55 +01:00
Vladimir Serbinenko
68a9136e4d
COMMON: Rewrite Encoder and drop dependency on iconv (#2586)
Different platforms have different levels of support of encodings and
often have slight variations. We already have tables for most encoding
with only CJK missing. Full transcoding inclusion allows us to get reliable
encoding results independently of platform. The biggest con is the need for
external tables encoding.dat.

It removes a duplicate table for korean in graphics/korfont.cpp
2020-11-15 16:20:35 +01:00
Mathias Parnaudeau
4880fab063 COMMON: Use appropriate equals() in BaseString
Remove a useless creation of a BaseString object with a C string in
comparison operators of this class, because there is a function
equals() that accepts a C string in parameter.
2020-11-06 21:21:05 +00:00
Thierry Crozat
e5bfe63087 COMMON: Merge the String and U32String destructors
The call to decRefCount has been moved to the destructor
of the base class BaseString.

Note that BaseString only exists for the purpose of being able
to reuse code for our String and U32String implementations. As
such it is not meant to be used polymorphically and its
destructor does not need to be virtual (with the overhead that
this generates). And to ensure that it is not used in a
polymorphic way, the destructor is declared protected.
2020-11-05 23:52:19 +00:00
Thierry Crozat
f18ee89b27 JANITORIAL: Fix indentation issues 2020-11-05 23:52:19 +00:00
Vladimir Serbinenko
54b0b4ac4c COMMON: Restore old behaviour for appending char to string
Appending \0 to string and expecting it to be just dropped is
still an invalid behaviour but it already happened in 2 engines, so
restore old behaviour, at least for now
2020-11-03 11:19:20 +01:00
Paul Gilbert
7775330954 COMMON: Ignore string erase calls when the passed length is zero 2020-11-02 21:49:05 -08:00
Vladimir Serbinenko
0d7ab6cd64 COMMON: compilation fix on some older compilers 2020-11-01 14:58:46 +01:00
Vladimir Serbinenko
29cfa7bb0f COMMON: Merge code for str.cpp and ustr.cpp
Most of the code in str.cpp and ustr.cpp is actually the same. Do some
template magic to merge them.
2020-10-31 14:05:30 +01:00