Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • what is the encoding of the file you define the string in? Commented Nov 26, 2013 at 9:07
  • 3
    Not sure what the problem is. UTF-16LE isn't Unicode, but it's what Microsoft calls "Unicode". Describe your goal, not your process. Commented Nov 26, 2013 at 9:09
  • "index=索引?".encode('utf-16be') gives b'\x00i\x00n\x00d\x00e\x00x\x00=}"_\x15\x00?' . What output did you want instead? Commented Nov 26, 2013 at 9:15
  • i want to convert the characters to the format '\uXXXX'. like this: index=\u0069\u006e\u0064\u0065\u0078\u003d\u7d22\u5f15\u003f Commented Nov 27, 2013 at 1:36