Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(5192)

Issue 217064: code review 217064: Count utf8 runes, not bytes when determining string wid... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 2 months ago by mnehpets
Modified:
14 years, 2 months ago
Reviewers:
CC:
r, golang-dev
Visibility:
Public.

Description

Count utf8 runes, not bytes when determining string width. Note that pad() still counts bytes, but it's currently only used for 1 byte runes. Fixes issue 612.

Patch Set 1 #

Patch Set 2 : code review 217064: Count utf8 runes, not bytes when determining string wid... #

Patch Set 3 : code review 217064: Count utf8 runes, not bytes when determining string wid... #

Total comments: 1

Patch Set 4 : code review 217064: Count utf8 runes, not bytes when determining string wid... #

Patch Set 5 : code review 217064: Count utf8 runes, not bytes when determining string wid... #

Patch Set 6 : code review 217064: Count utf8 runes, not bytes when determining string wid... #

Patch Set 7 : code review 217064: Count utf8 runes, not bytes when determining string wid... #

Patch Set 8 : code review 217064: Count utf8 runes, not bytes when determining string wid... #

Patch Set 9 : code review 217064: Count utf8 runes, not bytes when determining string wid... #

Patch Set 10 : code review 217064: Count utf8 runes, not bytes when determining string wid... #

Patch Set 11 : code review 217064: Count utf8 runes, not bytes when determining string wid... #

Patch Set 12 : code review 217064: Count utf8 runes, not bytes when determining string wid... #

Patch Set 13 : code review 217064: Count utf8 runes, not bytes when determining string wid... #

Patch Set 14 : code review 217064: Count utf8 runes, not bytes when determining string wid... #

Patch Set 15 : code review 217064: Count utf8 runes, not bytes when determining string wid... #

Patch Set 16 : code review 217064: Count utf8 runes, not bytes when determining string wid... #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -2 lines) Patch
M src/pkg/fmt/fmt_test.go View 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/fmt/format.go View 2 chunks +2 lines, -1 line 0 comments Download
M src/pkg/fmt/print.go View 3 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 12
mnehpets
Hello r (cc: golang-dev@googlegroups.com), I'd like you to review this change.
14 years, 2 months ago (2010-02-20 05:31:50 UTC) #1
r2
See updated issue 612. -rob
14 years, 2 months ago (2010-02-20 08:36:04 UTC) #2
r
i'm inclined to take this if the doc comment is updated to state what padding ...
14 years, 2 months ago (2010-02-22 03:48:27 UTC) #3
mnehpets
How about %s -> width of string is counted as number of bytes, %#s -> ...
14 years, 2 months ago (2010-02-23 05:43:04 UTC) #4
rsc
# already has meaning, and this applies to every format, not just %s. Russ
14 years, 2 months ago (2010-02-23 06:33:26 UTC) #5
r2
On 23/02/2010, at 5:33 PM, Russ Cox wrote: > # already has meaning, and this ...
14 years, 2 months ago (2010-02-23 07:12:29 UTC) #6
mnehpets
Hello r (cc: golang-dev@googlegroups.com), Please take another look.
14 years, 2 months ago (2010-02-28 02:18:20 UTC) #7
r
http://codereview.appspot.com/217064/diff/3001/3004 File src/pkg/fmt/print.go (right): http://codereview.appspot.com/217064/diff/3001/3004#newcode47 src/pkg/fmt/print.go:47: of UTF-8 runes in the string. This differs from ...
14 years, 2 months ago (2010-02-28 02:26:31 UTC) #8
mnehpets
Hello r (cc: golang-dev@googlegroups.com), Please take another look.
14 years, 2 months ago (2010-02-28 05:37:26 UTC) #9
r
LGTM
14 years, 2 months ago (2010-02-28 05:43:49 UTC) #10
r
*** Submitted as http://code.google.com/p/go/source/detail?r=9a458c87c6e7 *** Count utf8 runes, not bytes when determining string width. Note ...
14 years, 2 months ago (2010-02-28 10:16:06 UTC) #11
ken3
14 years, 2 months ago (2010-02-28 10:53:56 UTC) #12
shouldnt you be on a plane?

On Sun, Feb 28, 2010 at 2:16 AM,  <r@golang.org> wrote:
> *** Submitted as
> http://code.google.com/p/go/source/detail?r=9a458c87c6e7 ***
>
> Count utf8 runes, not bytes when determining string width. Note
> that pad() still counts bytes, but it's currently only used for
> 1 byte runes.
>
> Fixes issue 612.
>
> R=r
> CC=golang-dev
> http://codereview.appspot.com/217064
>
> Committer: Rob Pike <r@golang.org>
>
>
> http://codereview.appspot.com/217064/show
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b