v0.7.5e: added desktop support for asian languages

This commit is contained in:
Evan Debenham
2019-10-23 20:34:06 -04:00
parent 7181b5b677
commit 9f8791978a
4 changed files with 95 additions and 34 deletions
@@ -21,6 +21,8 @@
package com.shatteredpixel.shatteredpixeldungeon.messages;
import com.badlogic.gdx.Application;
import com.badlogic.gdx.Gdx;
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
@@ -88,7 +90,17 @@ public class Messages {
while (keys.hasMoreElements()) {
String key = keys.nextElement();
String value = bundle.getString(key);
//TODO do all desktop platforms read as ISO, or only windows?
// should also move this to platform support, probably.
if (Gdx.app.getType() == Application.ApplicationType.Desktop) {
try {
value = new String(value.getBytes("ISO-8859-1"), "UTF-8");
} catch (Exception e) {
ShatteredPixelDungeon.reportException(e);
}
}
strings.put(key, value);
}
}