UnicodeDecodeError: 'utf8' codec can't decode byte 0xd4

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.
Message
Author
User avatar
Asahel
Newbie
Posts: 24
Joined: Fri Nov 14, 2014 10:38 am
Contact:

Re: UnicodeDecodeError: 'utf8' codec can't decode byte 0xd4

#16 Post by Asahel »

Same thing.

However, one thing I noticed and hopefully might give a clue is that when I remove the "import aiml" line in AIMLbot.py and run the game, the error changes to

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 10, in script
    $ import AIMLBot
  File "game/script.rpy", line 10, in <module>
    $ import AIMLBot
NameError: name 'aiml' is not defined
So the script loads but obviously cannot find what it needs.
I'm getting the utf8 error only when Renpy tries to import aiml - it's the same with my own AIML python script.

User avatar
Asahel
Newbie
Posts: 24
Joined: Fri Nov 14, 2014 10:38 am
Contact:

Re: UnicodeDecodeError: 'utf8' codec can't decode byte 0xd4

#17 Post by Asahel »

To be more exact, if I make a simple hello.py script with only print "Hello world" and import it into renpy, I don't get any error and I see "Hello world" in the terminal when I run the game.

When I add import aiml at the beginning of that script - instant utf8 error! Same script, same encoding.

User avatar
Karl_C
Veteran
Posts: 232
Joined: Sun Mar 31, 2013 6:18 am
Contact:

Re: UnicodeDecodeError: 'utf8' codec can't decode byte 0xd4

#18 Post by Karl_C »

Ok, let's try a different approach.

I built a distribution package of my working example, it contains all necessary files. Can you download it and try if it works on your machine?

IF it works (it should?), copy the 'game' folder with all files into your SDK directory and use it as a template.

For those who want to try: Warning! Eileens replies are not written by me, but generated 'just-in-time' by pyAIML, using the Free A.L.I.C.E. AIML Set (licensed under the GNU Lesser GPL). If you get strange or rude replies during your 'discussion' with the bot, don't blame me!

The example contains code fragments from Sergey Zakharov too.
Attachments
AIML-1.0-all.zip
Working example of a pyAIML chatterbot used in Ren'Py
(33.83 MiB) Downloaded 51 times

User avatar
Asahel
Newbie
Posts: 24
Joined: Fri Nov 14, 2014 10:38 am
Contact:

Re: UnicodeDecodeError: 'utf8' codec can't decode byte 0xd4

#19 Post by Asahel »

You, sir, are a genius!! :shock:

I was missing the xml folder and the pprint.py. If the pprint is optional and written by you, then the culprit must have been the xml folder which I think I didn't have in the pyAIML distribution I was using...
Attachments
Screenshot.png

User avatar
Karl_C
Veteran
Posts: 232
Joined: Sun Mar 31, 2013 6:18 am
Contact:

Re: UnicodeDecodeError: 'utf8' codec can't decode byte 0xd4

#20 Post by Karl_C »

Hm, I have no idea why you got this 'utf8' error? I got an error that xml.sax and pprint couldn't be found before I downloaded and extracted both into the 'game' directory.

Anyway, I'm glad to hear that you got it working finally. :-)

BTW, just a hint: You're not dependent on user input. For example, I tested pyAIML and 'Jokes.aiml' from Square Bear's AIML files together with saguaro's 'Basic Message System', and it worked quite well. The bot would send me a randomly selected joke to my virtual inbox each time I triggered it with

Code: Select all

response = k.respond("TELL ME A JOKE")
add_later("LOL", "Eileen", "[response]")
But I guess this doesn't match the subject 'UnicodeDecodeError' any more, so I better shut up... ;)

Post Reply

Who is online

Users browsing this forum: Google [Bot]