running feature files with embedded UTF-16

Likely a newbie question.  The project I have has feature files with scenarios that have UTF-16 characters in them.  This is legitimate, as these characters are data passed to the AUT.  Rubymine correctly identifies the files as UTF16LE.  However, when I try to run these, I get "invalid byte sequence in UTF-8 (ArgumentError)".  How do I get around this? Is there some run configuration setting that I need?

7 comments
Comment actions Permalink

I think you need to specify soure file encoding with head comment "encoding: utf-16" (see
http://nuclearsquid.com/writings/ruby-1-9-encodings/ for better explanation)

Hope this helps, Oleg.

0
Comment actions Permalink

Thanksfor the suggestion, Oleg.  I tried it, but got the same failure ("invalid byte sequence in UTF-8 (ArgumentError)").  Here is my last attempt (with the "encoding" line added):

# encoding: utf-16
Feature: test_utf16
   Scenario: QRY_GRA_RPA_AQM1_u061f
      Given log in as a "CAS" user
      And create a new project
      And select the "CAplus/REGISTRY" database
      When perform a search using the term "2012:1161489/AN and Last¿ /ti"
      Then the resulting database "CAplus" hit count is ">0"
      When perform a search using the term "L1 and 2012:1161489/AN"
      Then the resulting database "CAplus" hit count is ">0"
      When select the title of record "1" in the "CAplus" summary list
      Then the "CAplus" detail record has the answer number "2012:1161489" in the "title line" field

The "upside-down question mark" is intentional, and what causes Rubymine to tag the feature file as UTF-16.  We have dozens of scenarios similar to this, with one or more UTF-16 characters.

Terry

0
Comment actions Permalink

Could you please provide a small project which demonstrates the problem.

Regards, Oleg.

0
Comment actions Permalink

Hi Oleg, sorry, got distracted for a couple days.  I attached a small project with a very simple feature file that causes the "invalid byte sequence in UTF-8 (ArgumentError)" error when I run it.



Attachment(s):
project_test_utf-16_sample.zip
0
Comment actions Permalink

Hi,

it looks like there is a bug in cucumber (at least something very similar to bug).
I'd suggest to report it either on Cucumber's issues tracker (https://github.com/cucumber/cucumber/issues?state=open), or on its mailing list (https://groups.google.com/forum/?fromgroups#!forum/cukes).

Regards, Oleg.

0
Comment actions Permalink

Thanks for the suggestion, Oleg.  I appreciate your time on this.

Terry

0
Comment actions Permalink

You are always welcome :)

0

Please sign in to leave a comment.