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

Question about JsonEscapeUtil. #861

Closed
zoooooway opened this issue Sep 13, 2024 · 2 comments
Closed

Question about JsonEscapeUtil. #861

zoooooway opened this issue Sep 13, 2024 · 2 comments

Comments

@zoooooway
Copy link

I noticed that JsonEscapeUtil has the following code:

static String getObligatoryEscapeCode(char c) {
      if (c < 32)
          return ESCAPE_CODES[c];
      if (c == 0x22)
          return "\\\"";
      if (c == 0x5C)
          return "\\/";

      return null;
  }

I'm curious as to why the escape character for 0x5C is ”\/” instead of "\\". Can anyone tell me why?

@ceki
Copy link
Member

ceki commented Sep 20, 2024

@zoooooway It's a bug. Thank you for catching this. The return value should have been the java string "\\" or the string "\" as you suggested.

@ceki
Copy link
Member

ceki commented Sep 20, 2024

Fixed in commit 5dfbb61

@ceki ceki closed this as completed Sep 20, 2024
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