Open N1nj4R4bb1D opened 8 years ago
Hmm, what OS are you running? And if you're running Windows, is your system codepage set to 932 (Japanese) by chance?
Windows 10 (64-bit) and indeed language for non-Unicode programs is set to Japanese (which is required to run Japanese games in many cases). What was interesting with this encounter was that it came up with only one game from those i tested (i can recheck with different locale if you want).
No thanks, I think I've figured it out. I was a bit sloppy and assumed that Ruby would be using UTF-8 for string literals, but it seems it uses the encoding of the source file, which makes sense. However, if you don't specify in the source file that it's encoded in UTF-8, it assumes the system codepage (which in your case was CP932) which it can't concatenate with the strings that it read from the files which it explicitly encoded to UTF-8. (It worked for me because my codepage is UTF-8.)
I think I'm doing a poor job of explaining this, but I'm about to merge your pull request with my own code and that should hopefully be a bit clearer.
I'm getting a very similar error, "E:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wolftrans-0.2.0/lib/wolfrpg/filecoder.rb:86:in `encode': incomplete "\x81" on Windows-31J (Encoding::InvalidByteSequenceError)" My non-Unicode language is set to Japanese, I'm not sure if the project has been abandoned at this point, but is there anything I can do about this?
Encountered this problem with one game. I fixed it for myself by cobbling together an additional exception handling in patch_text.rb:254