s6465456 / google-apps-shell

Automatically exported from code.google.com/p/google-apps-shell
0 stars 0 forks source link

Problem interpreting text in UTF-8 #8

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Load a CSV with UTF-8 characters, like "ã"
2. Execute a command that uses the loaded CSV

What is the expected output? What do you see instead?
A: Expect to execute the command, but we are receiveing "UnicodeErrorCode: 
'ascii' codec can't encode character U'\xc3' in position 54: ordinal not in 
range(128)"

What version of the product are you using? On what operating system?
A: Using on Linux, with python 2.6.6. Using GASI 1.1.7

Original issue reported on code.google.com by sombr...@gmail.com on 3 Mar 2011 at 3:56

GoogleCodeExporter commented 9 years ago
Got the same problem. This is because the reader doesn't do any check on input 
encoding and expect old legacy ASCII compatible characters.

You can easily solve the problem by modifying the "gasi.py" file.

Look for this line (should be line 426 in version 1.1.7)

master_template.append(str(line))

and transform it like this

master_template.append(str(line.encoding('UTF-8'))

You can change 'UTF-8' to wathever encoding your CSV is. This should do the 
trick. Hope they will fix that in future version.

Original comment by grapesh...@gmail.com on 25 Jun 2012 at 2:53