foreign characters in utf-8 encoded squiffy file

sostlund
Compiling a squiffy source file with Swedish characters such as Å,Ä,Ö caused the python command to fail. The following modification to squiffy.py seems to allow proper utf-8 handling of these characters:

replace the line

input_data = input_file.read()

by

input_data = input_file.read().decode('utf-8')


Maybe there is a better way to automatically detect the file encoding?

Alex
Thanks, Python is a pain for Unicode (well, v2 is anyway).

Could you log this as an issue on GitHub please, or even better, send a Pull Request so I can just merge the change straight in? https://github.com/textadventures/squiffy

Thanks!

sostlund
I posted this as an issue but not as a pull request; I don't want to suggest my solution too emphatically since I have not thought about side effects.

braqx
The probleme is the same in german language by using 'ÄÜ etc.'
To solve this issue, I think it could be the smartest way to insert "<meta http-equiv="content-type" content="text/html; charset=utf-8">" in the head-section automaticly when a new "index.html" is compiling.
For now, I insert this tag manual every time I compile a new "index.html". It's not the best way to solve the problem, but be sure: it works out... :-)

This topic is now closed. Topics are closed after 180 days of inactivity.

Support

Forums