rb files saved in ANSI instead of UTF-8

15 views
Skip to first unread message

Attila Franczen

unread,
Mar 25, 2013, 1:01:11 PM3/25/13
to test...@googlegroups.com
Hello guys,

I am new to Testwise, but already I ran into something which might force me to drop this software, even though I find it really great so far.
My problem is that it saves the files in ANSI format, which makes it impossible for me to deal with cyrillic characters.
Can I somehow have all my files saved in UTF-8?
Check the following simple code:
    def random_string(length=10)
      chars = 'йцукенгшщз'
      russian= ''
      length.times { russian<< chars[rand(chars.size)] }
      russian
    end
    @browser.text_field(:id,"element_1").set(random_string(5))
Because of the ANSI files, this does not work as expected. If however the rb file is saved as UTF-8, then it works fine.
Internationalization, and thus the characters is really important for me.

Any suggestions, please? I would really appreciate it.




Zhimin

unread,
Mar 25, 2013, 4:25:54 PM3/25/13
to test...@googlegroups.com
Hi,

TestWise  (Ruby more precisely) supports unicode.  

Just add 

# encoding: utf-8

as the beginning of the file.

You can find unicode example test scripts at "samples\unicode_cn_reference".

Cheers,
Zhimin
Reply all
Reply to author
Forward
0 new messages