Skip to content

json.Unmarshal doesn't properly decodes escaped Unicode characters #73

@dchest

Description

@dchest
What steps will reproduce the problem?

s := `{"tweets" : [{"text" :
"\u0422\u0443\u043b\u0430"}]}`;
json.Unmarshal(s, &timeline);

See attached json-test.go.


What is the expected output? What do you see instead?

Expected: text should be unmarshalled to "Тула".
Instead: empty string


Which revision are you sync'ed to?  (hg log -l 1)
changeset:   3960:de1a91a5a801
tag:         tip
user:        Russ Cox <rsc@golang.org>
date:        Tue Nov 10 17:09:33 2009 -0800
summary:     net: fix dns bug reported on irc.

Attachments:

  1. json-test.go (500 bytes)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions