Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error "invalid byte sequence in utf-8" when using INI_ENCODING #112

Open
chosenofbear opened this issue Jun 19, 2015 · 1 comment
Open

Comments

@chosenofbear
Copy link

I am trying to run a RMXP game with Chinese title. If I do not compile mkxp with INI_ENCODING, it will throw the error "invalid byte sequence in utf-8" immediately when I start the game. If I compile rmxp with INI_ENCODING, the title can be displayed, but the same error again is thrown when the game's customized script starts reading the ini file:

file = File.open('Game.ini','r')
file.each {|line|
line.gsub!(/\n/,"") #error when reading the line with Chinese title in Game.ini
...

This does not happen with the original RMXP Game.exe.

@Ancurio
Copy link
Owner

Ancurio commented Jun 19, 2015

Hmm, so the ini file is not UTF-8 but some Chinese encoding, but Ruby in mkxp always expects to be dealing with UTF-8. The RMXP RGSS dll probably has a work-around to deal with Chinese encoded files.

The fix seems easy enough, either convert the ini to UTF-8 with your favorite text editor, or put the ini contents directly into the script instead of having them read from the ini.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants