<div dir="ltr"><div><div>Hi,<br><br></div>It's not anything to do with the font.<br><br></div>Qt uses 16-bit unicode strings internally. If you give a str to a PySide function, it will need to decode it, and by default it will probably treat it as ASCII. If you want Qt to assume 8-bit strings are UTF-8 encoded, you can use the following:<br><br>
<p style="margin:0px;text-indent:0px">from PySide.QtCore import QTextCodec</p>
<p style="margin:0px;text-indent:0px">QTextCodec.setCodecForCStrings(QTextCodec.codecForName("UTF-8"))</p><p style="margin:0px;text-indent:0px"><br></p><p style="margin:0px;text-indent:0px">However it would be better practice to pass it unicode strings if you can.</p><p style="margin:0px;text-indent:0px"><br></p><p style="margin:0px;text-indent:0px">Dan<br></p><br><div><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On 3 March 2016 at 00:45, Frank Rueter | OHUfx <span dir="ltr"><<a href="mailto:frank@ohufx.com" target="_blank">frank@ohufx.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Thanks guys.<span><br>
<br>
>>That would imply that your tooltip uses a different default
font.<br></span>
Aha, that makes perfect sense, thank you!<br>
I'm currently on OSX using Wing as my IDE. When I ran this code
inside a host application, it worked fine (because it changes the
default font).<br>
I will verify that though before moving on. Text encoding/decoding
always confuses me (I hardly have to deal with it, so there is no
routine) and I want to get it right this time.<br>
<br>
Cheers,<br>
frank<div><div><br>
<br>
<div>On 03/03/2016 06:26 AM, Tim Roberts
wrote:<br>
</div>
</div></div><blockquote type="cite"><div><div>
<div>Sebastian Elsner | RISE wrote:<br>
</div>
<blockquote type="cite">
Unicode is tricky, it bites me every time. This works:<br>
</blockquote>
<br>
It's not that hard. There are two possibilities. Either the
setTool function does not accept Unicode strings, or the default
tool tip font does not include those extended characters.<br>
<br>
<br>
<blockquote type="cite">Please
note, the .py file actually has to be saved/encoded as utf-8.
You need to do this via your editor's save/convert function.<br>
</blockquote>
<br>
Actually, it doesn't. There are no characters in his file beyond
the base ASCII set, except for the one character in a comment, so
the file coding is irrelevant. If this worked for you, then his
original code would have worked for you also. That would imply
that your tooltip uses a different default font. No one here has
mentioned what operating systems they are using; that makes a
difference.<br>
<pre cols="72">--
Tim Roberts, <a href="mailto:timr@probo.com" target="_blank">timr@probo.com</a>
Providenza & Boekelheide, Inc.
</pre>
<br>
<fieldset></fieldset>
<br>
</div></div><span><pre>_______________________________________________
PySide mailing list
<a href="mailto:PySide@qt-project.org" target="_blank">PySide@qt-project.org</a>
<a href="http://lists.qt-project.org/mailman/listinfo/pyside" target="_blank">http://lists.qt-project.org/mailman/listinfo/pyside</a>
</pre>
</span></blockquote>
<br>
</div>
<br>_______________________________________________<br>
PySide mailing list<br>
<a href="mailto:PySide@qt-project.org" target="_blank">PySide@qt-project.org</a><br>
<a href="http://lists.qt-project.org/mailman/listinfo/pyside" rel="noreferrer" target="_blank">http://lists.qt-project.org/mailman/listinfo/pyside</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div><div dir="ltr"><div><div dir="ltr"><div>Dan Milburn</div><div>Software Engineer - Nuke</div><div><div>The Foundry</div><div>5 Golden Square</div><div>London</div><div>W1F 9HT</div><div>Tel: <a href="tel:%2B44%280%29%2020%207479%204350" value="+442074794350" target="_blank">+44(0) 20 7479 4350</a> • Fax: <a href="tel:%2B44%20%280%2920%207434%202526" value="+442074342526" target="_blank">+44 (0)20 7434 2526</a> • Web: <a href="http://www.thefoundry.co.uk" target="_blank">http://www.thefoundry.co.uk</a></div></div><div><br></div><div>The Foundry Visionmongers Ltd.</div><div>Registered in England and Wales No: 4642027</div><div><br></div><div><br></div><div><br></div></div></div></div></div>
</div></div></div></div></div></div>