[LDTP-Dev] UTF-8 characters in settextvalue method

Ara Pulido ara at ubuntu.com
Fri Aug 1 04:48:00 PDT 2008


Hey Nagappan,

It is working perfectly now, thanks!

I have created PPA packages for Ubuntu Intrepid (available at
https://launchpad.net/~apulido/+archive)

Cheers,
Ara.

On Thu, 2008-07-31 at 09:48 -0700, Nagappan A wrote:
> Hi Ara,
> 
> I have fixed this issue, will check in the code by end of day. If you
> still face this issue, please send us the test script to verify and
> fix at our end.
> 
> I tried something like this
> 
> settextvalue ('*-gedit', 'txt0', 'C:\薔薇\ソ\表') and this worked for
> me.
> 
> Thanks
> Nagappan
> 
> On Thu, Jul 31, 2008 at 2:38 AM, Ara Pulido <ara at ubuntu.com> wrote:
>         Hello all,
>         
>         I am trying to write a script that will open a Gedit session,
>         will write
>         some japanese chracters, will save and it will be compared to
>         an already
>         saved file.
>         
>         The same test using ascii characters works neatly, but in this
>         case I
>         always get this error:
>         
>         Traceback (most recent call last): File
>         "/usr/bin/ldtprunner", line
>         424, in executescript execfile (scriptname, scriptglobal) File
>         "gedit_chains.py", line 24, in <module> test.write_text(chain)
>         File
>         "/usr/lib/python2.5/site-packages/ubuntutesting/ubuntu.py",
>         line 138, in
>         write_text Application.write_text(self, text,
>         ubuntu_constants.GE_TXT_FIELD) File
>         "/usr/lib/python2.5/site-packages/ubuntutesting/ubuntu.py",
>         line 118, in
>         write_text app_txt_field.settextvalue(text) File
>         "/var/lib/python-support/python2.5/ooldtp.py", line 453, in
>         settextvalue
>         return ldtp.settextvalue (self.__window, self.getName (''),
>         args [0])
>         File "/var/lib/python-support/python2.5/ldtp.py", line 805, in
>         settextvalue _message = generatexml (command.SETTEXTVALUE,
>         _requestId,
>         windowName, componentName, text) File
>         "/var/lib/python-support/python2.5/ldtp.py", line 84, in
>         generatexml
>         _argDebug += ", " + str (args [index]) UnicodeEncodeError:
>         'ascii' codec
>         can't encode characters in position 27-30: ordinal not in
>         range(128)
>         
>         I have tried encoding that, but finally ldtp library always
>         tries to
>         encode that to ascii.
>         
>         Have you managed to get such a test running successfully?
>         
>         Thanks,
>         Ara.
>         
>         _______________________________________________
>         LDTP-dev mailing list
>         LDTP-dev at lists.freedesktop.org
>         http://lists.freedesktop.org/mailman/listinfo/ldtp-dev
> 
> 
> 
> -- 
> Linux Desktop (GUI Application) Testing Project -
> http://ldtp.freedesktop.org
> http://nagappanal.blogspot.com
> 



More information about the LDTP-dev mailing list