Skip to content
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
Open

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

rogpeppe opened this issue Nov 3, 2014 · 1 comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@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
Copy link
Contributor

Comment 1:

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

@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
@ALTree ALTree added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants