Bluefish is selecting a non-UTF8 encoding based on reading Python source code, namely a function call with parameter ' encoding="ISO-8859-1" '. This can be fixed by splitting that string parameter into a plus-concatenation. See attached files.
what I don't know: is python sourcecode alsways in UTF-8 ? If so we can force UTF8 for every python file. If not we have to try and guess (which we currently do, resulting in the problem you describe)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Python allows specifying the source file encoding at either the first or second line, see https://www.python.org/dev/peps/pep-0263/ . A regular expression is provided there for allowed directive formats. Default is ASCII for Python2 and UTF8 for Python3.
I would suggest a printed warning for this type of situations, which override preferences and locale.
Finally, the "Document/Character Encoding" options seem to do nothing in this case, but I didn't research much.
Cheers and let me know if I can help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
yes I understand why this is happening.
what I don't know: is python sourcecode alsways in UTF-8 ? If so we can force UTF8 for every python file. If not we have to try and guess (which we currently do, resulting in the problem you describe)
Python allows specifying the source file encoding at either the first or second line, see https://www.python.org/dev/peps/pep-0263/ . A regular expression is provided there for allowed directive formats. Default is ASCII for Python2 and UTF8 for Python3.
I would suggest a printed warning for this type of situations, which override preferences and locale.
Finally, the "Document/Character Encoding" options seem to do nothing in this case, but I didn't research much.
Cheers and let me know if I can help.
I just found https://www.python.org/dev/peps/pep-0263/ which describes the proper python encoding.
encoding detection according the pep-0263 is now properly detected in revision 8872
Closing as the issue has been resolved. If not, please open a new ticket.