0

I am using the Neomodel library to bind my Neo4j database with Django framework. Trying to get an instance from my DB via local shell, I am getting an encoding error:

city = PlaceName.index.search(name=u'Zürich') UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 1: ordinal not in range(128) 

How can I avoid this?

5
  • You are sure that you have your table with correct encoding ? utf-8 ? Commented Jul 1, 2014 at 10:43
  • PlaceName is a class: class PlaceName(StructuredNode): name = StringProperty(index=True, required=True) lang = StringProperty(index=True, required=True) type = StringProperty(index=True, required=True) hasid = RelationshipTo('PlaceId', 'HAS_ID') descr = RelationshipTo('Desc', 'HAS_DESC') Commented Jul 1, 2014 at 13:07
  • But it's about your database for example for MySQL stackoverflow.com/questions/3832056/… Commented Jul 1, 2014 at 13:11
  • I use a graph-database, NoSQL, I don't have tables of this kind Commented Jul 1, 2014 at 13:18
  • But you still got to select some sort of encoding for your text data. If you didn't select I suggest you to look at the default encoding for that field and how to change it, to UTF8 preferably. Commented Jul 1, 2014 at 14:04

1 Answer 1

0

Hmm ...

Can you please try this:

city = PlaceName.index.search(name=unicode('Zürich','utf-8')) 
Sign up to request clarification or add additional context in comments.

2 Comments

exactly the same error, but thank you for trying to help
Sorry mate ;/ I was doing my best.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.