fargoChen / androguard

Automatically exported from code.google.com/p/androguard
0 stars 0 forks source link

androaxml.py does not handle non-ASCII data when -o is not specified #72

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. An XML file containing non-ASCII data in an attributes
2. Decode an XML file using androaxml.py without specifying output file

What is the expected output? What do you see instead?

Expected output
----------------
Simply a dump to stdout.

Raised the following:
----------------
UnicodeEncodeError: 'ascii' codec can't encode characters in position ###-###: 
ordinal not in range(128)

Trace
----------------
Traceback (most recent call last):
  File "c:\androguard\androaxml.py", line 70, in <module>
    main(options, arguments)
  File "c:\androguard\androaxml.py", line 56, in main
    print codecs.decode(buff, "utf-32")
  File "C:\Python27\lib\encodings\utf_32.py", line 11, in decode
    return codecs.utf_32_decode(input, errors, True)
UnicodeEncodeError: 'ascii' codec can't encode characters in position ###-###: 
ordinal not in range(128)

What version of the product are you using? On what operating system?
134be8215a1c / Win32

Please provide any additional information below.
Occurs in main() during options check.  See attached patch.

Original issue reported on code.google.com by nom...@gmail.com on 21 Aug 2012 at 6:08

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by anthony....@gmail.com on 22 Aug 2012 at 6:44

GoogleCodeExporter commented 8 years ago
Have you an xml file for testing ?

Original comment by anthony....@gmail.com on 8 Oct 2012 at 1:17

GoogleCodeExporter commented 8 years ago

Original comment by anthony....@gmail.com on 28 Nov 2012 at 8:40