victords / super-bombinhas

A 2D platformer written in Ruby.
GNU General Public License v3.0
311 stars 16 forks source link

when change language, a crash occurred #1

Closed diogo-vf closed 4 years ago

diogo-vf commented 4 years ago

Hello, Nice game! When I test to change language the game crash with the next error:

Traceback (most recent call last):
        22: from game.rb:158:in `<main>'
        21: from E:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/gosu-0.15.2-x64-mingw32/lib/gosu/patches.rb:78:in `tick'
        20: from E:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/gosu-0.15.2-x64-mingw32/lib/gosu/patches.rb:78:in `tick'
        19: from game.rb:127:in `draw'
        18: from E:/Prog/super-bombinhas/menu.rb:227:in `draw'
        17: from E:/Prog/super-bombinhas/form.rb:296:in `draw'
        16: from E:/Prog/super-bombinhas/form.rb:296:in `each'
        15: from E:/Prog/super-bombinhas/form.rb:296:in `block in draw'
        14: from E:/Prog/super-bombinhas/form.rb:238:in `draw'
        13: from E:/Prog/super-bombinhas/form.rb:238:in `each'
        12: from E:/Prog/super-bombinhas/form.rb:238:in `block in draw'
        11: from E:/Prog/super-bombinhas/form.rb:81:in `draw'
        10: from E:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/minigl-2.3.3/lib/minigl/text.rb:235:in `write_breaking'
         9: from E:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/minigl-2.3.3/lib/minigl/text.rb:235:in `each'
         8: from E:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/minigl-2.3.3/lib/minigl/text.rb:246:in `block in write_breaking'
         7: from E:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/minigl-2.3.3/lib/minigl/text.rb:256:in `write_paragraph'
         6: from E:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/minigl-2.3.3/lib/minigl/text.rb:256:in `each'
         5: from E:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/minigl-2.3.3/lib/minigl/text.rb:257:in `block in write_paragraph'
         4: from E:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/minigl-2.3.3/lib/minigl/text.rb:63:in `markup_width'
         3: from E:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/minigl-2.3.3/lib/minigl/text.rb:63:in `reduce'
         2: from E:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/minigl-2.3.3/lib/minigl/text.rb:63:in `each'
         1: from E:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/minigl-2.3.3/lib/minigl/text.rb:63:in `block in markup_width'
E:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/minigl-2.3.3/lib/minigl/text.rb:63:in `index': incompatible character encodings: UTF-8 and CP850 (Encoding::CompatibilityError)
victords commented 4 years ago

Hi there, thanks for reporting this. I can't reproduce the problem here... The crash happens when you change to which language? Could you please check the encoding of the corresponding language file (/data/text/.txt)? Thanks!

Em dom., 20 de set. de 2020 às 17:25, Noxcaedibux notifications@github.com escreveu:

Hello, Nice game! When I test to change language the game crash with the next error:

Traceback (most recent call last): 22: from game.rb:158:in <main>' 21: from E:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/gosu-0.15.2-x64-mingw32/lib/gosu/patches.rb:78:intick' 20: from E:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/gosu-0.15.2-x64-mingw32/lib/gosu/patches.rb:78:in tick' 19: from game.rb:127:indraw' 18: from E:/Prog/super-bombinhas/menu.rb:227:in draw' 17: from E:/Prog/super-bombinhas/form.rb:296:indraw' 16: from E:/Prog/super-bombinhas/form.rb:296:in each' 15: from E:/Prog/super-bombinhas/form.rb:296:inblock in draw' 14: from E:/Prog/super-bombinhas/form.rb:238:in draw' 13: from E:/Prog/super-bombinhas/form.rb:238:ineach' 12: from E:/Prog/super-bombinhas/form.rb:238:in block in draw' 11: from E:/Prog/super-bombinhas/form.rb:81:indraw' 10: from E:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/minigl-2.3.3/lib/minigl/text.rb:235:in write_breaking' 9: from E:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/minigl-2.3.3/lib/minigl/text.rb:235:ineach' 8: from E:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/minigl-2.3.3/lib/minigl/text.rb:246:in block in write_breaking' 7: from E:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/minigl-2.3.3/lib/minigl/text.rb:256:inwrite_paragraph' 6: from E:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/minigl-2.3.3/lib/minigl/text.rb:256:in each' 5: from E:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/minigl-2.3.3/lib/minigl/text.rb:257:inblock in write_paragraph' 4: from E:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/minigl-2.3.3/lib/minigl/text.rb:63:in markup_width' 3: from E:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/minigl-2.3.3/lib/minigl/text.rb:63:inreduce' 2: from E:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/minigl-2.3.3/lib/minigl/text.rb:63:in each' 1: from E:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/minigl-2.3.3/lib/minigl/text.rb:63:inblock in markup_width' E:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/minigl-2.3.3/lib/minigl/text.rb:63:in `index': incompatible character encodings: UTF-8 and CP850 (Encoding::CompatibilityError)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/victords/super-bombinhas/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGR52QQJWCQLMEBSYJWT23SGZQMLANCNFSM4RT2TOOA .

diogo-vf commented 4 years ago

hi, i can see english, portuguese and spanish.
but on the interface, when i want switch to spanish or portuguese the app crash before to show the selected language.
the error message show bad encoding.

i've checked with VScode all files and it shows UTF-8 🤔 i don't understood where the error is coming from...

victords commented 4 years ago

Can you tell me your system details? I can try to reproduce it in a virtual machine.

Em sex., 25 de set. de 2020 às 05:53, Noxcaedibux notifications@github.com escreveu:

hi, i can see english, portuguese and spanish. but on the interface, when i want switch to spanish or portuguese the app crash before to show the selected language. the error message show bad encoding.

i've checked with VScode all files and it shows UTF-8 🤔 i don't understood where the error is coming from...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/victords/super-bombinhas/issues/1#issuecomment-698809658, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGR52RBYLKPWRL6RLGGH63SHRLBJANCNFSM4RT2TOOA .

diogo-vf commented 4 years ago

it's a configuration of my computer
image

and I have record how i have test your game :) (but the first time i've played 20 min on level) my video

victords commented 4 years ago

Hey!

I tried in a Windows 7 virtual machine and in a Windows 10 physical notebook, and it worked normally in both cases... Maybe the file got corrupted? Where did you download it from? Can you try downloading the game from https://victords.itch.io/super-bombinhas and see if it works?

Thanks!

victords commented 4 years ago

Actually @DiogoVieiraFerreira , looking at the stack trace I think maybe the problem is with the encoding of the source files! Can you check the encoding of the "global.rb" file?

diogo-vf commented 4 years ago

hi i use ruby 2.6.5 and i've pull your code on github. i've test on 2 pc and the bug is the same.

victords commented 4 years ago

Did you check the encoding of the "global.rb" source file? I believe it must be different from UTF-8, which is the encoding of the strings files...

diogo-vf commented 4 years ago

i've check all files on project and all files are on UTF-8 encoding and the sequence of end of line is CRLF.

diogo-vf commented 4 years ago

ok i've check with a newer ruby version... the problem is the version. i can change language and the app not crash

please specify on your install your ruby version ;)

victords commented 4 years ago

Hey, I was able to reproduce your problem when I installed Ruby 2.6.5 with the default settings, but I got it working by marking the option "Use UTF-8 as the default external encoding". It's not an issue with the version itself (version 2.6.5 works fine on Linux and on Windows with this setting). Also, the Ruby version is set in the Gemfile - the game should work with any version of Ruby >= 2.0.