span class="nb">isinstance</span><span class="p">(</span><span class="n">raw_data</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span>
                <span class="n">raw_data</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">raw_data</span><span class="p">,</span> <span class="s2">&quot;utf-8&quot;</span><span class="p">)</span>
        <span class="k">except</span> <span class="ne">UnicodeDecodeError</span><span class="p">:</s