Adds toggle for displaying generated entries or not + fixes issue when cleaning json strings

This commit is contained in:
infinitefusion
2024-12-23 23:52:04 -05:00
parent d2e5dfb8cd
commit 950c942b20
21 changed files with 41 additions and 14 deletions

View File

@@ -119,11 +119,11 @@ def downloadAllowed?()
end
def clean_json_string(str)
return str if $PokemonSystem.on_mobile
#echoln str
#return str if $PokemonSystem.on_mobile
# Remove non-UTF-8 characters and unexpected control characters
#cleaned_str = str.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
cleaned_str = str
cleaned_str = str.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
# Remove literal \n, \r, \t, etc.
cleaned_str = cleaned_str.gsub(/\\n|\\r|\\t/, '')
@@ -137,6 +137,7 @@ def clean_json_string(str)
cleaned_str = cleaned_str.gsub(/\\u([\da-fA-F]{4})/) { |match|
[$1.to_i(16)].pack("U")
}
echoln cleaned_str
return cleaned_str
end