Encoding for OrientDB (can't send a literal string)
<p>I have the next problem. I need to create a vertex with a propertyA with a value 'Ø§ÙÙØ³Ø§Ø¡'. The problem is from python, python CAN'T send the string 'Ø§ÙÙØ³Ø§Ø¡' so...</p>

<p>I know I need to do a encode, like the next:</p>

<pre><code>&gt;&gt;&gt;a = 'Ø§ÙÙØ³Ø§Ø¡'
&gt;&gt;&gt;b = a.encode('cp270')
&gt;&gt;&gt;print b
&gt;&gt;&gt;'\x9f\xe9\xea\xab\x9f\x98'
</code></pre>

<p>But with this encode OrientDB won't work. I think that I need an ascii encode. </p>

<p>There is the problem (without response):
<a href="https://github.com/orientechnologies/orientdb/issues/5860" rel="nofollow">https://github.com/orientechnologies/orientdb/issues/5860</a></p>

<p>Anyone that know about OrientDB can help me? Thank in advance!</p>

<p>I have tried with this code with orientDb version 2.2.7</p>

<pre><code>import pyorient 

db_name='MyDb'

print("connection to the server...")
client=pyorient.OrientDB("localhost",2424)
client.set_session_token(True)
session_id=client.connect("root","root")

client.db_open( db_name, "admin", "admin" )

myFunction = 'insert into v(name) values("Ø§ÙÙØ³Ø§Ø¡")'
client.command(myFunction);

client.db_close() 
</code></pre>

<p>and it worked for me</p>

<p><a href="http://i.stack.imgur.com/YNAaG.png" rel="nofollow"><img src="http://i.stack.imgur.com/YNAaG.png" alt="enter image description here"></a></p>

<p>Hope it helps.</p>

python character-encoding orientdb