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.

6
  • I ran indexOf('\ufffd') on the string and it is not -1, what encoding would you say it is then? And what should I do to salvage this situation? Commented Jan 27, 2015 at 21:56
  • @Yongke: That doesn't tell us anything about the encoding - it just suggest that you're losing information, which doesn't surprise me. You should really tackle the problem at its root, but we don't know enough context to say more. Commented Jan 27, 2015 at 21:58
  • what if you have this kind of string that you want to convert to byte array [70, 77, 82, 0, 32, 50, 48, 0, 1, 34, 0, -61,-77, 4, 0, 0] Commented Nov 3, 2015 at 6:24
  • @ralphspoon: Then you would remove the square brackets, split on strings, and parse each byte's decimal representation. This is not really an encoding issue. Commented Nov 3, 2015 at 6:45
  • 1
    @JonSkeet what im expecting to happen is to get that string as a byte[] format. can you provide an example ? Commented Nov 3, 2015 at 6:59