[Tutor] Retain UTF-8 Character in Python List

Boy Sandy Gladies Arriezona reno.esper at gmail.com
Mon Jun 1 18:02:11 CEST 2015


On Mon, Jun 1, 2015 at 6:22 PM, Steven D'Aprano <steve at pearwood.info> wrote:
What do you mean, the Java program inserts it directly? Inserts it into
what?

I mean that java program use the list and directly send it into apache
phoenix to do "batch upsert".
I thought that because the list is not show me the way I set it, then it
will send the wrong data into
apache phoenix. I still haven't found the problem yet, I don't know which
program is at fault. Anyway,
your explanation is really good, thank you.


On Mon, Jun 1, 2015 at 4:55 PM, Peter Otten <__peter__ at web.de> wrote:
import json
items = [u"sffs © fafd"] # unicode preferrable over str for non-ascii
data
print json.dumps(items, ensure_ascii=False)
["sffs © fafd"]

I haven't try that, using unicode strings before append it into the list.
Awesome, I'll try it out later when
I got in the office. Thank you very much.
---
Best regards,
Boy Sandy Gladies Arriezona


More information about the Tutor mailing list