Skip to content

[Bug]: Project-file/code-component content is truncated when containing (some) emojis #19

@megholm

Description

@megholm

PsychoPy Version

2024.2.1post4

What OS are your PsychoPy running on?

Windows 10

Bug Description

I discovered a problem with the code-component ('s (de)serializer).

Take a simple project with just a code-component and the following (xml project) content:

<Param val="kButtonRatingText1 = '☺'&amp;#10;kButtonRatingText2 = '🙂'&amp;#10;kButtonRatingText3 = '😐'&amp;#10;kButtonRatingText4 = '🙁'&amp;#10;kButtonRatingText5 = '☹'&amp;#10;kText = '123'" valType="extendedCode" updates="constant" name="Before Experiment"/>

or:

kButtonRatingText1 = '☺'

kButtonRatingText2 = '🙂'

kButtonRatingText3 = '😐'

kButtonRatingText4 = '🙁'

kButtonRatingText5 = '☹'

kText = '123'

if you want.

Opening the code-block again the text gets truncated to:

<Param val="kButtonRatingText1 = '☺'&amp;#10;kButtonRatingText2 = '🙂'&amp;#10;kButtonRatingText3 = '😐'&amp;#10;kButtonRatingText4 = '🙁'&amp;#10;kButtonRatingText5 = '☹'&amp;#10;kText = '1" valType="extendedCode" updates="constant" name="Before Experiment"/>

image

Expected Behaviour

No truncation.

Steps to Reproduce

...

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions