How convert utf8 string to utf16 string in python3
<p>I have whole source code in utf8 (using "# -<em>- coding: utf-8 -</em>-" on second line)</p>

<p>In code I select from sqlite database string-value using sqlalchemy </p>

<pre><code>sel = u'SELECT name FROM station WHERE id == ...'
value = getattr(engine.execute(sel).fetchone(), u'name')
</code></pre>

<p>in database is column <code>name</code> created this way</p>

<pre><code>Column(u'name', String(length=32, convert_unicode=True)
</code></pre>

<p>After <code>select</code> I need convert <code>value</code> to utf16 (due to sending to Octave by SciPy)</p>

<p>How I can do this?</p>

<p>I try</p>

<pre><code>value = value.encode(u'utf-8').decode(u'utf-16')
</code></pre>

<p>but Octave still not accept some special characters (for expamle ě,š,č,ř,...)</p>

<p>PS.: I do this in function. I add <code>value</code> to dictionary</p>

<pre><code>updated_dict[u'name'] = value
</code></pre>

<p>then return <code>updated_dict</code> to caller function and export to .mat file</p>

<pre><code>scipy.io.savemat(filename,{u'save_struct':updated_dict})
</code></pre>