fixes crash with ai entries on mobile

This commit is contained in:
infinitefusion
2024-12-21 17:00:22 -05:00
parent 28d3ffc074
commit 81489ec8e6
5 changed files with 34 additions and 1 deletions

View File

@@ -120,7 +120,7 @@ end
def clean_json_string(str)
# Remove non-UTF-8 characters and unexpected control characters
cleaned_str = str.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
cleaned_str = str.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '') if !$PokemonSystem.on_mobile
# Remove literal \n, \r, \t, etc.
cleaned_str = cleaned_str.gsub(/\\n|\\r|\\t/, '')