Defining an image throws an error (encoding declaration in Unicode string)

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
PastelWolf88
Newbie
Posts: 16
Joined: Sun Mar 12, 2017 12:13 pm
Completed: They Would Call You Broken
Projects: The Moonstone Sword, The Violet Girls
itch: natekauko
Location: Finland
Contact:

Defining an image throws an error (encoding declaration in Unicode string)

#1 Post by PastelWolf88 »

I've been trying to put in an image like this in the beginning of script.rpy:

Code: Select all

image begin = "image1.png"
And call that image.

Code: Select all

show begin
But this throws an error:

Code: Select all

File "game/script.rpy", line 0: encoding declaration in Unicode string

Ren'Py Version: Ren'Py 7.4.8.1895
What does that mean? What's wrong with my picture? How can I fix it?

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: Defining an image throws an error (encoding declaration in Unicode string)

#2 Post by Per K Grok »

PastelWolf88 wrote: Thu Mar 10, 2022 3:45 am I've been trying to put in an image like this in the beginning of script.rpy:

Code: Select all

image begin = "image1.png"
And call that image.

Code: Select all

show begin
But this throws an error:

Code: Select all

File "game/script.rpy", line 0: encoding declaration in Unicode string

Ren'Py Version: Ren'Py 7.4.8.1895
What does that mean? What's wrong with my picture? How can I fix it?

Are you sure it is a problem with the image?

If you remove the code defining and showing that image, does the script work then?
If so. If you put the code back but with a different image, does it work then?

User avatar
PastelWolf88
Newbie
Posts: 16
Joined: Sun Mar 12, 2017 12:13 pm
Completed: They Would Call You Broken
Projects: The Moonstone Sword, The Violet Girls
itch: natekauko
Location: Finland
Contact:

Re: Defining an image throws an error (encoding declaration in Unicode string)

#3 Post by PastelWolf88 »

Per K Grok wrote: Thu Mar 10, 2022 8:27 am
PastelWolf88 wrote: Thu Mar 10, 2022 3:45 am I've been trying to put in an image like this in the beginning of script.rpy:

Code: Select all

image begin = "image1.png"
And call that image.

Code: Select all

show begin
But this throws an error:

Code: Select all

File "game/script.rpy", line 0: encoding declaration in Unicode string

Ren'Py Version: Ren'Py 7.4.8.1895
What does that mean? What's wrong with my picture? How can I fix it?

Are you sure it is a problem with the image?

If you remove the code defining and showing that image, does the script work then?
If so. If you put the code back but with a different image, does it work then?
I changed the picture and apparently the picture is not the problem. I can put that picture into previous projects... But for some reason I can't put background pictures into this one. Maybe this is an OS problem, this didn't happen before I switched to Linux Ubuntu. Or maybe a problem with Atom. Maybe I'll try with Windows 10 before I start pointing fingers.

Post Reply

Who is online

Users browsing this forum: No registered users