cucumber/cucumber-js — pull request #116 by bclozel (2013-03-27 09:14:14+00:00)
Title: Loading gherkin parser according language comment

Hello there.

This issue could be seen as a duplicate of #109 but @vslinko stopped working on this - I'm willing to give it a try.

I've been working on the same problems @vslinko faced in issue #109 : a lexing error when parsing the first non-comment line (exactly, when parsing the first keyword).
Tests and specs run ok this time - but I've stumbled on the same problems with the non-en parsers.

When debugging this issue, it seemed that valid data was passed to the non-en parser. I'm wondering if it's a parser issue or an encoding issue on our part.

Could you give me directions:
* how could I dig deeper into this?
* how could I create a sample testcase to check if this problem is on gherkin's/cucumber-js's side?
* should I request support on the mailing list?

Some details about this PR:
* works only if the "# language" meta is on the first line
* does a "featureSource.toString", which is not optimal for nodejs implementation (since we're converting the buffer to a plain string)
* this code should be modified in the future if we want to support other meta comments like "# encoding"