What are the semantics of .set_encoding()?
- I’ve got a file encoded using cp1250 with accented characters,
- I open this file in Sublime, unfortunately it’s able to interpret file content as ‘utf-8’ string, so the fallback encoding is not used:
>>> view.encoding()
u'UTF-8'
3) Then I call:
[code]>>> view.set_encoding(u’Central European (Windows 1250)’)
view.encoding()
u’Central European (Windows 1250)’[/code]
- However, it seems like Sublime did not reinterpret the file content (bytes) using new encoding, but simply stored new encoding to be used when saving.
Now that I think about it, this behaviour is reasonable. However I would like to be able somehow handle encoding specifying comments python.org/dev/peps/pep-0263/.
What do you think jps?