Open claytonneal opened 10 years ago
Thanks, will work on it
Great, its a problem when testing localised websites
I have just checked using VIM editor (in Mac OS) and it works for me. Could you maybe try some other editors? In a mean time I will investigate how to support multiple encodings
I was using notepad++ on windows, set to uft-8.
It could be a problem with the default encoding in your system. At any rate, I had the same problem when implementing localization tests. A workaround that worked for me was to use 'text matches' along with UNICODE_CHARACTER_CLASS of Pattern java class (what the implementation uses). You can use the embedded flag expression. In your case: text matches: (?U)LA QUALITÉ
I was right about to fix this issue when I stumble upon this line of code in galen:
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream, System.getProperty("file.encoding")));
So it seems that you can just set your own encoding through "file.encoding" system property
In order to set the system property just add it to your galen command like this: galen test . --htmlreport reports -Dfile.encoding=UTF-8
Could you please try it and check if it works for you?
-Dfile.encoding=UTF-8 don't works to me.
I'm solving it running command bellow after galen execution:
for f in `find htmlreport-dir -name *.html` ; do sed -i "s/<head>/<head><meta charset='utf\-8'>/g" $f ; done
@thr0w You mean it doesn't work in your html reports? Then I guess it is a different issue then. This specific story was about actual text validation and not about html report. So does the text validation work for you? As for the html related issue I guess we should just fix that in report template
Sorry. i'd mistake.
@thr0w well, I don't think its a mistake :) If it is an issue in the report - then we should still fix it there. could you please create a new story for this? I will assign it to the current milestone
Im validating a french website, using notepad++ i set the encoding of the spec file to UTF-8 and i use:
text is: LA QUALITÉ
this fails with:
.. should by "LA QUALITÃ%"