-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
Milestone
Description
When Fold.String/Narrow.String was called, it was lost one character.
want := "A" + strings.Repeat("0", 127) + "B"
got := width.Fold.String("\uff21" + strings.Repeat("0", 127) + "B")
=> got != want, "B" is lost.
conditions:
- long string (more than 128 [initialBufSize])
- contains wide character
initialBufSize from https://github.com/golang/text/blob/master/transform/transform.go#L506
cause:
https://github.com/golang/text/blob/master/width/transform.go#L25
Even when the length of "dst" is 0, "nSrc" increases one.
InitStmt(nSrc++) is necessary?
Reactions are currently unavailable