diff --git a/binding-mri/binding-mri.cpp b/binding-mri/binding-mri.cpp index 23f53e0..8465ae4 100644 --- a/binding-mri/binding-mri.cpp +++ b/binding-mri/binding-mri.cpp @@ -472,9 +472,6 @@ static void runRMXPScripts(BacktraceData &btData){ fname = newStringUTF8(buf, len); btData.scriptNames.insert(buf, scriptName); - - printf("%s\n", scriptName); - int state; evalString(string, fname, &state); if (state) diff --git a/binding-mri/filesystem-binding.cpp b/binding-mri/filesystem-binding.cpp index d42ae2f..c995efd 100644 --- a/binding-mri/filesystem-binding.cpp +++ b/binding-mri/filesystem-binding.cpp @@ -176,7 +176,6 @@ RB_METHOD(_marshalLoad){ RB_UNUSED_PARAM; VALUE port, proc = Qnil; rb_scan_args(argc, argv, "01", &port, &proc); - rb_p(proc); VALUE utf8Proc; if (NIL_P(proc)) { utf8Proc = rb_proc_new(RUBY_METHOD_FUNC(stringForceUTF8), Qnil); diff --git a/changelogs/0.1.1.txt b/changelogs/0.1.1.txt index 916f1f4..c156583 100644 --- a/changelogs/0.1.1.txt +++ b/changelogs/0.1.1.txt @@ -64,4 +64,6 @@ Modloader settings supported gamepads can now change LED color based on map sigc is wrapped in signal.h, added the ability to move window from ruby main viewport resize, main window resize and move signals bindings for ruby -Dynamic resolution support (WIP) \ No newline at end of file +Dynamic resolution support (WIP) +Rewrited to use SDL3 libc methods instead default +Removed useless debug logs diff --git a/scripts/i18n_Language.rb b/scripts/i18n_Language.rb index 8c3065c..7c09ab3 100644 --- a/scripts/i18n_Language.rb +++ b/scripts/i18n_Language.rb @@ -73,7 +73,7 @@ class Language lastLineWasMsgId = false lastLineWasMsgStr = false if FileTest.exist?(path) - File.readlines(path).each do |line| + File.readlines(path, encoding: "UTF-8").each do |line| if line.start_with?("msgid ") line = line[6..-1] #unescape the string @@ -129,16 +129,10 @@ class Language # Translate some text def tr(string) - if @data - rv = @data[Oneshot::crc32(string)] || string - else - rv = string - end - - if rv.nil? - rv = "NULL" - end - return String.new(rv) + return string unless @data + s = string.to_s.encode("UTF-8") + rv = @data[Oneshot::crc32(s)] || s + rv.nil? ? "NULL" : String.new(rv) end def loadFontMap @@ -146,8 +140,9 @@ class Language @languageFontMap = Hash.new path = "Languages/language_fonts.ini" if FileTest.exist?(path) - File.readlines(path).each do |line| + File.readlines(path, encoding: "UTF-8").each do |line| parts = line.split("=", 2) + #print(parts[0].inspect) if parts.length == 2 LANGUAGES.push(parts[0]) @languageFontMap[parts[0]] = parts[1].strip