How can I make psychopy display special characters in builder correctly?

224 views
Skip to first unread message

Piotr Faba

unread,
Jul 22, 2015, 9:20:57 AM7/22/15
to psychopy-users
Hello,

Setup information:
PsychoPy version: 1.82.01, on Windows 7 64-bit
Using Builder


Issue:
Normally, when one wants to add text in builder, one should use the Text Component and type the text in it. However, the whole thing stops working correctly once I start using characters that are specific for my langauge (Polish).
By stopping worrking correctly I mean:
  1. getting a message in the output: "Exception UnicodeDecodeError:"
  2. data files (csv or xlsx) not saving.
  3. the window does not close at the end and I need to use the Stop button to terminate the experiment

The characters that we have in the language that are beyond ASCII's scope are: ąęśćżźńłó and the capitals: ĄĘŚĆŹŻŃŁÓ. To make things even more wierd all these letters can be used in Text Component, but as I found only ó (\u00F3) and Ó (\u00D3) cause the trouble. As I mentioned they display correctly, but they cause problems 1 - 3. Moreover, using ó or Ó anywhere in the Coder Component, even in the comments (after #), causes the same problem.

By inspecting the Coder view I see that ó, for instance, get converted to '\xf3' instead '\u00f3'. All the others are transformed to the '\u....' form.

I am willing to modify my PsychoPy to make this work in Builder, but I do not know where to start. Namely, I do not know how identify function that replaces special chars with the escape strings when the script is being built and why it makes mistake on ó and Ó.

Finally, I found that ó and Ó are not the only unicode characters that are not supported well, but I didn't figure out the rule behind this. Examples include:
© and µ.

I would really appreciate some help with solving this problem.
Cheers,
Piotr

Michael MacAskill

unread,
Jul 22, 2015, 5:55:10 PM7/22/15
to psychop...@googlegroups.com
Dear Piotr,

Did you see this message from Jon re a new (testing) release of PsychoPy, in which we addressed (some) Unicode errors?
<https://groups.google.com/forum/#!msg/psychopy-users/B5MoaZpBKOo/YLkCL36-o4UJ>

You could try that out to see if it addresses your problems.

But in the current release, do you find that using .xlsx rather than .csv for conditions files makes a difference?


Regards,

Michael
--
Michael R. MacAskill, PhD 66 Stewart St
Research Director, Christchurch 8011
New Zealand Brain Research Institute NEW ZEALAND

Senior Research Fellow, michael....@nzbri.org
Te Whare Wānanga o Otāgo, Otautahi Ph: +64 3 3786 072
University of Otago, Christchurch http://www.nzbri.org/macaskill



Piotr Faba

unread,
Jul 28, 2015, 8:15:08 AM7/28/15
to psychopy-users, michael....@otago.ac.nz
Dear Michael,

Sorry for a late reply. Let me start from the end.

As for your second suggestion, the answer is no. Changing the output settings does not influence the PsychoPy behavoiur in my case. With either .csv or .xlsx exporting, it would not terminate if ó letter appears in CoderComponent or TextComponent.

As for the first suggestion, thank you so much for mentioning it. It seems to have solved the issue for the machine I prepare experiments on.

Many thanks,
Piotr

Piotr Faba

unread,
Jul 28, 2015, 8:47:26 AM7/28/15
to psychopy-users, michael....@otago.ac.nz, pdf...@gmail.com
For anyone interested in the issue.

To pin down the issue, I prepared as simple experiment as I need to recreate the issue. I attach it for the reference. I found that the problem does not occur, if no loops are present in the psyexp. Hence, without the loops ó character displays and the experiment terminates. With simple loop added, the experiment fails to terminate.

As mentioned above the PsychoPy-1.82.02rc1.zip fixes this issue for me on two computers now (Windows 7 x64 and Windows XP x64).
test_o.psyexp
Reply all
Reply to author
Forward
0 new messages