Language translation error

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
Obscura
Eileen-Class Veteran
Posts: 1431
Joined: Fri Mar 09, 2012 6:58 pm
Projects: Coming Out On Top
Location: United States
Contact:

Language translation error

#1 Post by Obscura »

A player is trying to translate a game (by dropping the translation files into the appropriate folder) but getting the following error:


> I'm sorry, but an uncaught exception occurred.
>
> While parsing C:\Program Files (x86)\Steam\steamapps\common\Coming Out
> on Top/game/tl/languagetwo/endings.rpy.
> UnicodeDecodeError: 'utf8' codec can't decode byte 0xba in position
> 159: invalid start byte

Code: Select all

>
> -- Full Traceback
> ------------------------------------------------------------
>
> Full traceback:
>   File "C:\Program Files (x86)\Steam\steamapps\common\Coming Out on
> Top\renpy\bootstrap.py", line 313, in bootstrap
>     renpy.main.main()
>   File "C:\Program Files (x86)\Steam\steamapps\common\Coming Out on
> Top\renpy\main.py", line 357, in main
>     renpy.game.script.load_script()  # sets renpy.game.script.
>   File "C:\Program Files (x86)\Steam\steamapps\common\Coming Out on
> Top\renpy\script.py", line 266, in load_script
>     self.load_appropriate_file(".rpyc", ".rpy", dir, fn, initcode)
>   File "C:\Program Files (x86)\Steam\steamapps\common\Coming Out on
> Top\renpy\script.py", line 732, in load_appropriate_file
>     data, stmts = self.load_file(dir, fn + source)
>   File "C:\Program Files (x86)\Steam\steamapps\common\Coming Out on
> Top\renpy\script.py", line 555, in load_file
>     stmts = renpy.parser.parse(fullfn)
>   File "C:\Program Files (x86)\Steam\steamapps\common\Coming Out on
> Top\renpy\parser.py", line 2722, in parse
>     lines = list_logical_lines(fn, filedata, linenumber)
>   File "C:\Program Files (x86)\Steam\steamapps\common\Coming Out on
> Top\renpy\parser.py", line 214, in list_logical_lines
>     data = f.read().decode("utf-8")
>   File
> "/home/tom/ab/x64lucid-deps/install/lib/python2.7/encodings/utf_8.py",
> line 16, in decode
> UnicodeDecodeError: 'utf8' codec can't decode byte 0xba in position
> 159: invalid start byte
>
> Windows-8-6.2.9200
> Ren'Py 7.1.3.1092
> Wed May 15 01:31:30 2019
Anybody have any insight into this or experience with translation files? Thanks!
Coming Out On Top - An Adult Gay Dating Sim
website

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: Language translation error

#2 Post by Per K Grok »

Obscura wrote: Tue May 14, 2019 3:00 pm A player is trying to translate a game (by dropping the translation files into the appropriate folder) but getting the following error:


> I'm sorry, but an uncaught exception occurred.
>
> While parsing C:\Program Files (x86)\Steam\steamapps\common\Coming Out
> on Top/game/tl/languagetwo/endings.rpy.
> UnicodeDecodeError: 'utf8' codec can't decode byte 0xba in position
> 159: invalid start byte

Code: Select all

>
> -- Full Traceback
> ------------------------------------------------------------
>
> Full traceback:
>   File "C:\Program Files (x86)\Steam\steamapps\common\Coming Out on
> Top\renpy\bootstrap.py", line 313, in bootstrap
>     renpy.main.main()
>   File "C:\Program Files (x86)\Steam\steamapps\common\Coming Out on
> Top\renpy\main.py", line 357, in main
>     renpy.game.script.load_script()  # sets renpy.game.script.
>   File "C:\Program Files (x86)\Steam\steamapps\common\Coming Out on
> Top\renpy\script.py", line 266, in load_script
>     self.load_appropriate_file(".rpyc", ".rpy", dir, fn, initcode)
>   File "C:\Program Files (x86)\Steam\steamapps\common\Coming Out on
> Top\renpy\script.py", line 732, in load_appropriate_file
>     data, stmts = self.load_file(dir, fn + source)
>   File "C:\Program Files (x86)\Steam\steamapps\common\Coming Out on
> Top\renpy\script.py", line 555, in load_file
>     stmts = renpy.parser.parse(fullfn)
>   File "C:\Program Files (x86)\Steam\steamapps\common\Coming Out on
> Top\renpy\parser.py", line 2722, in parse
>     lines = list_logical_lines(fn, filedata, linenumber)
>   File "C:\Program Files (x86)\Steam\steamapps\common\Coming Out on
> Top\renpy\parser.py", line 214, in list_logical_lines
>     data = f.read().decode("utf-8")
>   File
> "/home/tom/ab/x64lucid-deps/install/lib/python2.7/encodings/utf_8.py",
> line 16, in decode
> UnicodeDecodeError: 'utf8' codec can't decode byte 0xba in position
> 159: invalid start byte
>
> Windows-8-6.2.9200
> Ren'Py 7.1.3.1092
> Wed May 15 01:31:30 2019
Anybody have any insight into this or experience with translation files? Thanks!
I think the problem is the coding used for the txt file with the translation. There is a sign in that text that the decoder can not read. You could try to change the coding of the translation file to UTF-8. You will have a chance to do that if you use "save as..." on the file.

I will have to admit that I don't know if this is the best way of tackling the problem, or even a good way. But that is my thought for what it is worth. :)

User avatar
Obscura
Eileen-Class Veteran
Posts: 1431
Joined: Fri Mar 09, 2012 6:58 pm
Projects: Coming Out On Top
Location: United States
Contact:

Re: Language translation error

#3 Post by Obscura »

Thanks so much Grok!
I believe you are correct. FWIW, apparently just using jedit instead of an alternate editor solved the issue. :)
Coming Out On Top - An Adult Gay Dating Sim
website

Post Reply

Who is online

Users browsing this forum: No registered users