scalapb/ScalaPB

UTF-8 Strings are unparseable?

Closed this issue · 2 comments

Uh, I'm not entirely sure where to open this, but it seems that UTF-8 encoded strings are often unparseable?

  def thereAndBackAgain(g: MyProto): Try[MyProto] = {
    val str = new String(g.toByteArray, StandardCharsets.UTF_8)
    Try(MyProto.parseFrom(str.getBytes(StandardCharsets.UTF_8)))
  }

will fail anytime a negative number appears in the proto or for some obscure strings. I reproed this via scalacheck -- I can probably spin off a minimal project to demonstrate this but it was fairly easy to produce that outcome.

Closing since this is not an issue with ScalaPB. Let me know if you have any additional questions.