UnicodeEncodeError in script.rpy

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
Bobr_dobr
Newbie
Posts: 1
Joined: Sun Jul 13, 2014 10:44 am
Contact:

UnicodeEncodeError in script.rpy

#1 Post by Bobr_dobr »

Hello. I have a problem:
When I want show 'chp' as value in text on Russian, Renpy gives me an error:

Code: Select all

While running game code:
  File "game/script.rpy", line 15, in script
    b ""Random, [chp]. Russian text."
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-5: ordinal not in range(128)
In script it looks like this:

Code: Select all

define chp = Character(u'Russian name', color="#FF4500")
define b = Character('Blah', color="#FFDEAD")

# Start
label start:
    hp "Russian text"
    b "Random, [chp]. Russian text."
If chp = "Russian name" - it works, but I need exactly Character.
With english name of character it works fine, with russian - not. Tried almost everything, but no result.

User avatar
SONTSE
Regular
Posts: 96
Joined: Sun Nov 24, 2013 10:49 pm
Completed: 11 VN's so far
Discord: jkx0282_10798
Contact:

Re: UnicodeEncodeError in script.rpy

#2 Post by SONTSE »

Try %(chp)s instead of [chp]. Seems same result and works with Russian.

Post Reply

Who is online

Users browsing this forum: No registered users