Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String character after emoji when deserialize a json #46

Closed
SmileZero opened this issue Apr 11, 2018 · 2 comments
Closed

String character after emoji when deserialize a json #46

SmileZero opened this issue Apr 11, 2018 · 2 comments

Comments

@SmileZero
Copy link

Hi, I tried to parse the json like the following one by the newest version 1.7.1.

{"1":"457899683877105664","2":2084,"3":{"safe":0.11111111,"blessed":0.11111111,"easter":0.11111111,"hope":0.11111111},"4":"I hope everyone has a safe and blessed Easter :) 💗"}

My Code is as below:

public class TopicHandler {
    private static final DslJson.Settings settings = Settings.withRuntime().allowArrayFormat(true).includeServiceLoader();
    private static final DslJson<Object> json = new DslJson<Object>(settings);
    .....
    public void handle(RoutingContext routingContext) {
        Map<String, Object> mapContent2 = json.deserialize(Map.class, str.getBytes(), str.getBytes().length);
        System.out.println(mapContent2.get("4").toString());
    }
}

It shows me a strange character after the emoji.

I hope everyone has a safe and blessed Easter :) 💗

Do you know why? It seems every emoji will be with a strange character after deserialization

@zapov
Copy link
Member

zapov commented Apr 11, 2018

It was a bug in the library ;(

I've fixed it on branch for next version: c23f79b

Branch is stable if you wish to build it yourself. I plan on releasing a new version by the end of this week.

Tnx for the bug report

@SmileZero
Copy link
Author

Thank you so much. We were really struggling with whether our data is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants