theganyo / ugc

Usergrid Command Line
6 stars 1 forks source link

ugc does not properly parse unicode #10

Closed erfanian closed 11 years ago

erfanian commented 11 years ago

Updating or retrieving Unicode characters like dogé does not work in ugc. The characters will not display correctly.

theganyo commented 11 years ago

Hmm. Could you provide more details? I'm able to create and retrieve a test like the following without trouble:

ugc create test '{"name": "dogé"}'

erfanian commented 11 years ago

Here was my command:

ugc create dog "name: 'tomé', name: 'test'"

response:

error: invalid byte sequence in UTF-8

theganyo commented 11 years ago

Odd. I can run that exact command in my terminal just fine.

What version of Ruby are you running? ruby -v

Can you run the command with the --verbose flag and post all the results here? ugc --verbose create dog "name: 'tomé', name: 'test'"

erfanian commented 11 years ago

ruby -v

ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]

No luck with the verbose output:

ugc --verbose create dog "name: 'tomé', name: 'test'"

error: invalid byte sequence in UTF-8

Here’s what happens when I post it on the web interface and call from the command line (ignore the formatting):

ugc show dogs

ââââââââââââ³âââââââââââââââââââââââââââââââââââââââ

â name     â value                                â

â£ââââââââââââââââââââââââââââââââââââââââââââââââââ«

â uuid     â 787a2a21-76bb-11e2-a7da-02e81aeb26e9 â

â£ââââââââââââââââââââââââââââââââââââââââââââââââââ«

â name     â tomé                                 â

â£ââââââââââââââââââââââââââââââââââââââââââââââââââ«

â created  â 1360855832677                        â

â£ââââââââââââââââââââââââââââââââââââââââââââââââââ«

â modified â 1360855832677                        â

ââââââââââââ»âââââââââââââââââââââââââââââââââââââââ

theganyo commented 11 years ago

Hmm. So there's some issue the character set that you're using - it's delivering invalid UTF-8 characters to Ruby. I haven't run it on Linux... but I wonder if it's an encoding issue with the terminal you're using?

By the way, if you want to have output without the formatting boxes (nice for pasting into messages like this), you can use the "ugc --no-border" option. :)

erfanian commented 11 years ago

Hmm that is a definite possibility. Thanks for the --no-border tip! I'll close the issue because it works for you.

theganyo commented 11 years ago

Thanks. I'd like to figure this out, though. If you run into any clues, please let me know.