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

Capture group positions are incorrect for UTF-8 steps #28

Open
aslakhellesoy opened this issue Jan 8, 2010 · 0 comments
Open

Capture group positions are incorrect for UTF-8 steps #28

aslakhellesoy opened this issue Jan 8, 2010 · 0 comments

Comments

@aslakhellesoy
Copy link
Contributor

This step:

Feature: UTF-8 bug

  Scenario: the bug
    Given Hellesøy has some scandinavian characters

And this step definition:

[Given(@"^(.*) has some (.*) characters$")]
public void IHaveSomeInternationalCharacters(string who, string what)
{
}

Gives me the following output:

Given Hellesøy has some_scandinavian_n characters

(I used italic to show the highlighted parameters). This is because the byte_offset for each capture group is incorrectly calculated. It reports character offset, but needs to report byte offset (some characters are 2 bytes). Cuke4Duke does this correctly - see http://github.com/aslakhellesoy/cuke4duke/blob/master/cuke4duke/src/main/java/cuke4duke/internal/language/StepArgument.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant