Re: NVDA Developer Guide: Question about how to make addons using standard NotePad
Luke Davis
In Python3, all source files are assumed to be UTF-8.
toggle quoted messageShow quoted text
In Python2, they are assumed to be ASCII, unless you include that famous encoding comment at the top. Although some (most?) add-on devs encode Python2 files in UTF-8, but don't include the magic comment for some reason. That said, if you save as ASCII, I believe the world won't actually end. I have done it, and not run into problems. But, I only write in characters below 127--I'm very vanilla that way. But if you want to be future-safe, saving in UTF-8 is always preferable. I vaguely remember hearing somewhere that NVDA strengthens Python's assumption to a requirement for some reason (translations?), but I can't find anything in any of the guides about it. I do know that for most things (manifests, dictionaries, etc.), NVDA does require UTF-8 encoding. Luke
On Sun, 9 Jun 2019, Daniel Gartmann wrote:
The last time I played with writing .py files in Notepad, I had to change the encoding in the Save dialog. It was not just using the standard Save command. Right now, I don’t recall how the file should be encoded in order to work properly in NVDA.
|
|