Jolly
Jolly

Reputation: 399

Libgdx I18NBundle, cant show scandinavian letters

So I've created a I18NBundle for all my strings to support different languages, my problem is that when i draw the strings in my game, the letters æ ø and å wont show, so that something that should be: "Spil på tid" shows up like: "Spil p tid", without the letter.

I don't know what I've done wrong, but you would think that something that is created to support different languages would be able to show the country-specific letters and characters.

Here is my 2 .properties files:

infinite_mode=Play Infinite
timed_mode=Play Timed
options=Options
quit=Quit game
option_flip=Flip numpad
option_language=Change language
back=Back to main menu
wrong_number=You pressed the\nwrong number
time_ran_out=Time ran out
reach_50="You have reached 50
score=Score: {0}
time=Time: {0}
numbers_left=Numbers left: {0}
start_over=Start over
leaderboard=Leaderboard
plus_seconds=+{0} seconds!
option_sound=Sound

And the danish one:

infinite_mode=Spil Evigt
timed_mode=Spil på tid
options=Instillinger
quit=Afslut spil
option_flip=Vend numpad
option_language=Skift sprog
back=Tilbage til hovedmenuen
wrong_number=Du trykkede på\ndet forkerte tal
time_ran_out=Tiden løb ud
reach_50="Du har nået 50
score=Point\: {0}
time=Tid: {0}
numbers_left=Tal tilbage: {0}
start_over=Start forfra
leaderboard=Resultattavle
plus_seconds=+{0} sekunder!
option_sound=Lyd

And here is the place where i create the bundle:

FileHandle baseFileHandle = Gdx.files.internal("Language/Lang");
        Locale Dansk = new Locale("da", "DK"); //The danish pack
        Locale English = new Locale("en", "GB"); //The English pack

        Lang = I18NBundle.createBundle(baseFileHandle, Dansk);

Upvotes: 3

Views: 685

Answers (2)

AndroLogiciels
AndroLogiciels

Reputation: 196

Be careful the caractere may not be located/created in the police

Upvotes: 0

Jolly
Jolly

Reputation: 399

I actually solved the problem, my self with a lot of help from Thorbjørn Ravn Andersen. The problem was in IntelliJ. In settings, the file encoding for '.properties' files were not UTF-8, and by changing that, I solved the problem.

Upvotes: 5

Related Questions