It's odd, and the oddness comes from the strconv package. But it's not incorrect.
It happens because \x7f is kinda sort not ASCII, at least as far as strconv thinks. It's trivial to "fix", though, if a fix is necessary. https://github.com/golang/go/issues/52062 -rob On Thu, Mar 31, 2022 at 4:40 PM Zachary Collier <zachmcoll...@gmail.com> wrote: > > 9 years in the future: > > This is why I cared: https://go.dev/play/p/F4GlQBQL7UC > > It's the only ASCII character showing as Unicode. When testing, I was alarmed > thinking I had an error, but it was inaccurately represented as Unicode. > The length is accurate. > fmt.Printf("Byte 127 len: %d\n", len([]byte{127})) > > > On Wednesday, June 26, 2013 at 1:16:42 PM UTC-6 gus...@niemeyer.net wrote: >> >> On Wed, Jun 26, 2013 at 4:08 PM, Rob Pike <r...@golang.org> wrote: >> > It is arbitrary. Why do you care? That implies a non-arbitrary thought >> > process. >> >> Even if I agree, my brain tends to appreciate non-arbitrariness for >> whatever reason. If I feed it things that look alike, it tends to spot >> their meaning more quickly. >> >> >> gustavo @ http://niemeyer.net > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/60ad41f0-10d6-417d-a604-6a151c357d93n%40googlegroups.com. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOXNBZTv146FgLc6HzKZvC4k0UOLSdWf58deZOzOq%3DZuU-Z3Eg%40mail.gmail.com.