简体   繁体   中英

Notepad++ changes the encoding of my code

I've some python code, that contains recognition for some hindi text. I deliberately save it as UTF-8 , but when I re-open it, the hindi symbols change to russian text(mostly) or simply a ? . The encoding too changes to OEM 866 which is cyrillic.

Here are the screenshots, (lines 90 and 98): 在此输入图像描述 在此输入图像描述

Because of this encoding change, my code too isn't running at all, as the regular expressions consider ? as a special input. So what should I do?

Encoding the script to utf-8-BOM would do the job. But BOM itself has problems of it's own . Basically, if you're using shebangs, then using BOM encoding would render the script uninterpretable.


EDIT: A notepad++ contributor on github rddim replied to the issue opened by me :

I can't reproduce this, because may be I have missed fonts. On 1st screen your file is in UTF-8 and the 2nd is in OEM-866 . Check the state of Autodetect character encoding in Settings > Preferences... > MISC.. If it is enabled just disable it and try again. Also your Debug Information missed the info from ? > Debug Info...

Worked for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM