If you are using Windows, make sure that you use the correct char
encoding when copying resources in Maven (utf-8 instead of the local
windows locale), if the story files are copied from src to the
target/classes dir, the files may get converted otherwise. This doesn't
happen in the IDE since it uses the story files in the source dir.
On 17.04.2012 12:50, Augusto Rodriguez Caceres wrote:
Hi All,
I got an error today, that I’m sure is trivial, but I haven’t been able
to find an answer on the list or on other sites. Just in case, I’m
running the tests on a Windows 7 machine with a uk locale.
I have a step with the following text
Given the narrative is 入金
When I run jBehave inside intellij everything is happy, but when I run
it from the command line using maven the test fails, as jbehave is not
loading those two characters as Unicode characters, but rather 3
characters. Here’s the output
java.lang.AssertionError:
Expected: "ÕàÑÚçæ"
got: "??"
The “got” part is ok, as the windows console can’t display unicode
characters, but the expected (which is taken from the step) is incorrect.
I’m wondering if I need to set up something in the configuration to hint
jbehave to load the story files using UTF-8, but I have the idea that it
already does so. In the meantime I’m getting the bytes from the string,
and creating a new string with the “UTF-8” charset and that does the
trick, but I’m sure there’s an easier, more transparent way.
Thanks a lot!
Augusto
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email