diff options
Diffstat (limited to 'modules/websocket/library_godot_websocket.js')
-rw-r--r-- | modules/websocket/library_godot_websocket.js | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/modules/websocket/library_godot_websocket.js b/modules/websocket/library_godot_websocket.js index 5d3baa0d2b..7076a6f43d 100644 --- a/modules/websocket/library_godot_websocket.js +++ b/modules/websocket/library_godot_websocket.js @@ -162,10 +162,8 @@ var GodotWebSocket = { for(i = 0; i < p_buf_len; i++) { bytes_array[i] = getValue(p_buf + i, 'i8'); } - var out = bytes_array; - if (p_raw) { - out = bytes_array.buffer; - } else { + var out = bytes_array.buffer; + if (!p_raw) { out = new TextDecoder("utf-8").decode(bytes_array); } return GodotWebSocket.send(p_id, out); |