summaryrefslogtreecommitdiff
path: root/byte_stream.gd
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2025-04-07 11:45:05 +0200
committerDaniel Weipert <git@mail.dweipert.de>2025-04-07 11:45:05 +0200
commitf3d360e022fce829370c7d916abe98083b14818c (patch)
tree4ac9f886b45a9482dcd42e991e85ab2e4bea3dbc /byte_stream.gd
parentbd77c88efc9327805b6f6fd83fa0492ed59d0f9a (diff)
next commitHEADmain
Diffstat (limited to 'byte_stream.gd')
-rw-r--r--byte_stream.gd9
1 files changed, 9 insertions, 0 deletions
diff --git a/byte_stream.gd b/byte_stream.gd
index 219e977..5477422 100644
--- a/byte_stream.gd
+++ b/byte_stream.gd
@@ -100,3 +100,12 @@ func get_string_from_utf8(length: int) -> String:
func get_string_from_ascii(length: int) -> String:
return get_buffer(length).bytes.get_string_from_ascii()
+
+func get_string_from_ro(length: int) -> String:
+ var buffer := get_buffer(length).bytes
+ Engine.print_error_messages = false
+ var string := buffer.get_string_from_multibyte_char("EUC-KR")
+ Engine.print_error_messages = true
+ if string.is_empty():
+ return buffer.get_string_from_ascii()
+ return string