delax / bibliocraft-book-formatter

Write BiblioCraft compatible books from plain text.
4 stars 4 forks source link

Text file Encoding issue #12

Open philbibliography opened 2 years ago

philbibliography commented 2 years ago

Hello, not sure if you're still active, but I encountered a problem with the script. I open the GUI app, type in everything I need to but when I try to start the converting process, this appears:

Exception in Tkinter callback Traceback (most recent call last): File "C:\Python34\lib\tkinter__init.py", line 1487, in call__ File "formatter_gui.py", line 198, in write_some_books File "X:\Python34\lib\encodings\cp1250.py", line 23, in decode UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 408: character maps to

Can you tell me how to fix this please? I tried installing Python 3.4.0 and uninstalling the latest Pythin version and still nothing...

delax commented 2 years ago

It's been a bit, I'll fire it up and see if i get something similar.

delax commented 2 years ago

So, if you used the "formatter_gui.exe", then you do not need to install anything. It comes with "python34.dll" and other stuff. This lets it run all from the folder, without you installing python.

(That's what CXFreeze does, in case you wondered)

As for the error...

test.txt Hm it seems to work with this test.txt file.

Does this work for you @philbibliography ? What were you trying to convert?

philbibliography commented 2 years ago

Well, I tried to convert this: Life of Plotinus.txt I want to make a library in Minecraft of all the treatises of Plotinus (54) plus his biography written by Porphyrius as a personal project. Each one of them will have its own book. I have already built the building using a schematic I found online with Bibliocraft bookshelves instead of normal ones and when I tried to convert the error popped up. Also, the test file worked perfecty. big book Delax, Test.txt

delax commented 2 years ago

Ok so I tried that file and I got the same error, AND I got the error when running without the GUI.

Turns out it's something about the encoding of the file that makes my simple code sad? But if it's saved as ANSI (which is more basic) it works.

TL;DR

  1. Open your file in Notepad
  2. Save As
  3. Change "Encoding:" to "ANSI"
  4. Save it with new name
  5. Use the New text file
philbibliography commented 2 years ago

Thank you so much, it works now!

delax commented 2 years ago

Excellent! If I get a couple days, I'll look into the why and fix it. Or at the very least, force convert to ANSI haha