New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/text/unicode/norm: LastBoundary is inconsistent #9055

Open
rogpeppe opened this Issue Nov 3, 2014 · 1 comment

Comments

Projects
None yet
4 participants
@rogpeppe
Copy link
Contributor

rogpeppe commented Nov 3, 2014

The LastBoundary methods seems inconsistent as to
where it reports a boundary. When called with a string
containing a single (non-combining) character, the boundary
is sometimes reported at the start of the string
and sometimes at the end:

This code:

    fmt.Printf("%d\n", norm.NFD.LastBoundary([]byte("a")))
    fmt.Printf("%d\n", norm.NFD.LastBoundary([]byte("♔")))

print 0 and 3. I would expect it to print 0 and 0 or 1 and 3.

Perhaps it would be better if neither FirstBoundary (LastBoundary)
never reported a boundary at the start (end) of a string.
That way it becomes easier to use FirstBoundary and LastBoundary
to iterate through strings when use of Iter is not convenient.
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

ianlancetaylor commented Nov 3, 2014

Comment 1:

Labels changed: added repo-text, release-none.

@rogpeppe rogpeppe added new labels Nov 3, 2014

@bradfitz bradfitz removed the new label Dec 18, 2014

@rsc rsc added this to the Unplanned milestone Apr 10, 2015

@rsc rsc removed the release-none label Apr 10, 2015

@rsc rsc changed the title go.text/unicode/norm: LastBoundary is inconsistent x/text/unicode/norm: LastBoundary is inconsistent Apr 14, 2015

@rsc rsc modified the milestones: Unreleased, Unplanned Apr 14, 2015

@rsc rsc removed the repo-text label Apr 14, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment