Skip to content

Commit

Permalink
Fix struct.js to interpret C strings as UTF-8 strings (Addresses #150)
Browse files Browse the repository at this point in the history
  • Loading branch information
Meiguro committed Mar 12, 2016
1 parent e4c5a35 commit 66f8f4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/lib/struct.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct.types.cstring.get = function(offset) {
chars[j] = String.fromCharCode(buffer.getUint8(i));
}
this._advance = chars.length + 1;
return chars.join('');
return decodeURIComponent(escape(chars.join('')));
};

struct.types.cstring.set = function(offset, value) {
Expand Down

0 comments on commit 66f8f4f

Please sign in to comment.