Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NodeModelManager.get_or_create() fails when european characters are involved #196

Open
tonjo opened this issue Jun 21, 2013 · 0 comments
Open

Comments

@tonjo
Copy link
Contributor

tonjo commented Jun 21, 2013

Storing names like "Città" in Neo4j gives error
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 4: ordinal not in range(128)

So I decode the string as utf8 and everything seems good:

City.objects.get_or_create(name='Città'.decode('utf8'))
(<City: City object>, True)

True: is created.
If I try again:

City.objects.get_or_create(name='Città'.decode('utf8'))
(<City: City object>, True)

True, created again

City.objects.get_or_create(name='Città'.decode('utf8'))
(<City: City object>, True)
... and again.

using decode with standard characters gives no problems:

City.objects.get_or_create(name='SimCity'.decode('utf8'))
(<City: City object>, True)
City.objects.get_or_create(name='SimCity'.decode('utf8'))
(<City: City object>, False)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant