SDL: Remove check for SDL2 in convertEncoding()
SDL_iconv_string() is available even with SDL1
This commit is contained in:
parent
4de634ee76
commit
6dba0bbfd4
1 changed files with 0 additions and 4 deletions
|
@ -769,15 +769,11 @@ int SDL_SetColorKey_replacement(SDL_Surface *surface, Uint32 flag, Uint32 key) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
char *OSystem_SDL::convertEncoding(const char *to, const char *from, const char *string, size_t length) {
|
char *OSystem_SDL::convertEncoding(const char *to, const char *from, const char *string, size_t length) {
|
||||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
|
||||||
int zeroBytes = 1;
|
int zeroBytes = 1;
|
||||||
if (Common::String(from).hasPrefixIgnoreCase("utf-16"))
|
if (Common::String(from).hasPrefixIgnoreCase("utf-16"))
|
||||||
zeroBytes = 2;
|
zeroBytes = 2;
|
||||||
if (Common::String(from).hasPrefixIgnoreCase("utf-32"))
|
if (Common::String(from).hasPrefixIgnoreCase("utf-32"))
|
||||||
zeroBytes = 4;
|
zeroBytes = 4;
|
||||||
return SDL_iconv_string(to, from, string, length + zeroBytes);
|
return SDL_iconv_string(to, from, string, length + zeroBytes);
|
||||||
#else
|
|
||||||
return nullptr;
|
|
||||||
#endif // SDL_VERSION_ATLEAST(2, 0, 0)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue