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
The commit does not change the behaviour of the class but makes
its implementation more logical, and in line with how it was
originaly implemented (before being refactored in commit 1011508).
Both FROM_BE_* and TO_BE_* do the same thingi for example, but you
use this stream class to read from a BE or LE stream and convert
the values to native endianness, and thus it makes more sense to
use FROM_BE_* and FROM_LE_* instead of TO_BE_* and TO_LE_* (which
suggested that we read values in native endianness and then
convert to the specified endianness).
This function used to be called from the Engine class, but was
not longer used since commit 432fd522. The single remaining use
was an internal use in the SurfaceSdlGraphicsManager, and I kept
the behaviour there while removing the function.
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.
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.
U32String can contain characters from all languages, without relation
to the GUI's language. Therefore, we need to always call it.
Use case:
In Hebrew SQ3, when using the game's original save/restore dialogs, it's
possible to give save games Hebrew names.
What happens when we then use ScummVM's load dialog?
- If ScummVM's GUI language is Hebrew, it's calling BiDI algo, and
the text direction is OK.
- However, if ScummVM's GUI language is English, before this commit it
didn't call the BiDI algo, and the text was reversed.
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