You are here: PSPad forum > English discussion forum > BUG: ASCII files are opened using the the most recent choice in the format menu
Posted by: Get Free | Date: 2015-01-11 03:55 | IP: IP Logged
This assumes you have enabled the option "Ident.bytes in UTF-8 coding" in Program settings > Program (part 2).
Steps to reproduce the problem:
1. Launch PSPad with no opened files
2. In the "Format" menu, choose UTF-8
3. Now open a file that is in plain ASCII (no BOM, no special characters, just plain ASCII)
4. Hit Ctrl+S (Save the file)
Result:
The ASCII file was silently converted to UTF-8. It now has the BOM at the beginning.
Suggested solution:
When the encoding can't be determined, assume ANSI, not the last chosen option in the Format menu.
Edited 1 time(s). Last edit at 2015-01-11 03:55 by Get Free.
Posted by: pspad | Date: 2015-01-11 06:31 | IP: IP Logged
I am sorry, but I am not able to simulate it.
I followed steps you provided and PSPad open file as ANSI for me.
Go to program settings / Files and dirs (or the same option in Proiject setting if you use project) and check what is set as default CP for file opening. There should be Menu format settings, not a UTF-8.
You can se the current CP used for file in the status bar. If there is ANSI, file is saved as ANSI, not as UTF-8
Posted by: Get Free | Date: 2015-01-11 20:50 | IP: IP Logged
How strange, my default CP for files opening is set to "ANSI (Windows)".
This is what I do in more detail:
(Tested in PSPad 4.5.8 (2500), Windows Vista Home Premium)
3. Open in the HEX editor a file containing nothing but the character "a", and make sure it doesn't have the BOM mark
4. Close the HEX editor and select UTF-8 in the Format menu
5. Open the file in the normal text editor. It is detected as UTF-8
6. Without doing any modifications to the file, hit Ctrl+S and close it immediately
7. Open the file again in HEX editor. It now has the BOM mark
Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR