Skip to content

Commit

Permalink
Update ParserClass.gd
Browse files Browse the repository at this point in the history
Fix broken umlaut in strings.
  • Loading branch information
freehuntx authored Sep 16, 2021
1 parent 751241d commit 3fd550c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions addons/Seriously/ParserClass.gd
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ func TYPE_REAL_unpack(stream: StreamPeerBuffer) -> float:
# String
func TYPE_STRING_pack(value: String, stream: StreamPeerBuffer, add_type := true):
if add_type: stream.put_u8(TYPES.TYPE_STRING)
stream.put_u16(value.length())
stream.put_data(value.to_utf8())
# TODO: Find a better solution to parse strings. While this works, causes alot of overhead.
stream.put_utf8_string(value)
func TYPE_STRING_unpack(stream: StreamPeerBuffer) -> String:
return stream.get_utf8_string(stream.get_u16())
return stream.get_utf8_string()

# Rect2
func TYPE_RECT2_pack(value: Rect2, stream: StreamPeerBuffer, add_type := true):
Expand Down

0 comments on commit 3fd550c

Please sign in to comment.