Since the binaries are likely to be strings, unicode conversion makes more sense.

This commit is contained in:
Thomas Arts 2019-04-08 16:29:31 +02:00
parent 0c01215b6a
commit f5f007e74d

View File

@ -52,7 +52,7 @@ FUNCTION : {token, {function, TokenLine, 'FUNCTION' }}.
-{INT} : -{INT} :
{token, {int, TokenLine, parse_int(TokenChars)}}. {token, {int, TokenLine, parse_int(TokenChars)}}.
{STRING} : {STRING} :
{token, {string, TokenLine, list_to_binary(TokenChars)}}. {token, {string, TokenLine, unicode:characters_to_binary(TokenChars)}}.
{BITS} : {BITS} :
{token, {bits, TokenLine, bits(TokenChars)}}. {token, {bits, TokenLine, bits(TokenChars)}}.
@ -112,7 +112,7 @@ parse_hash("#" ++ Chars) ->
base64:decode(Chars). base64:decode(Chars).
parse_object([_|Chars]) -> parse_object([_|Chars]) ->
case aeser_api_encoder:decode(list_to_binary(Chars)) of case aeser_api_encoder:decode(unicode:characters_to_binary(Chars)) of
{account_pubkey, Bin} -> {address, Bin}; {account_pubkey, Bin} -> {address, Bin};
{contract_pubkey, Bin} -> {contract, Bin}; {contract_pubkey, Bin} -> {contract, Bin};
{oracle_pubkey, Bin} -> {oracle, Bin}; {oracle_pubkey, Bin} -> {oracle, Bin};