You are here: PSPad forum > Bug report / Hlášení chyb > PSPad removes UTF-8 BOM at beginning of file

PSPad removes UTF-8 BOM at beginning of file

#1 PSPad removes UTF-8 BOM at beginning of file

Posted by: Daniel Rentz | Date: 02/26/2010 13:25 | IP: IP Logged

When opening a UTF-8 file containing the BOM (byte order mark, byte sequence EF BB BF) at the beginning, PSPad should open the file in UTF-8 mode, and should save the BOM back to the file. Currently, the BOM gets lost.

Edited 2 time(s). Last edit at 02/26/2010 13:28 by Daniel Rentz.

Options: Reply | Quote | Up ^


#2 Re: PSPad removes UTF-8 BOM at beginning of file

Posted by: pspad | Date: 02/26/2010 13:42 | IP: IP Logged

program settings / program 2
[x]Indent bytes in UTF-8

Options: Reply | Quote | Up ^


#3 Re: PSPad removes UTF-8 BOM at beginning of file

Posted by: Daniel Rentz | Date: 03/02/2010 13:01 | IP: IP Logged

That helps, thanks.

Still, the "Format" menu shows "Ansi" when opening UTF-8 files, even if the file is edited in UTF-8 mode. Is *this* a bug?

Options: Reply | Quote | Up ^


#4 Re: PSPad removes UTF-8 BOM at beginning of file

Posted by: pspad | Date: 03/02/2010 14:53 | IP: IP Logged

If File has no BOM and doesn't contains chars over #127 ASCII, the content of the ANSI and UTF-8 is same. PSpad has no chance to recognize it.

Options: Reply | Quote | Up ^


#5 Re: PSPad removes UTF-8 BOM at beginning of file

Posted by: Vany | Date: 03/02/2010 17:35 | IP: IP Logged

But you can still set the UTF-8 as the default encoding for
unrecognized code pages instead of ANSI.

--
Vany
(PSPad 4.5.9 (2503), W7p x64 cs)

Options: Reply | Quote | Up ^


#6 Re: PSPad removes UTF-8 BOM at beginning of file

Posted by: Daniel Rentz | Date: 03/03/2010 12:18 | IP: IP Logged

The file in question contains a UTF-8 BOM and contains encoded non-ASCII characters which are shown/edited and saved correctly (after the [x] you mentioned above). Though, the menu shows a mark before ANSI. I expected the menu to show the encoding used for the current visible file (so the mark changes as I change between a UTF-8 file and another non-UTF-8 file).

Options: Reply | Quote | Up ^


#7 Re: PSPad removes UTF-8 BOM at beginning of file

Posted by: papi | Date: 03/03/2010 14:51 | IP: IP Logged

Daniel Rentz:
(so the mark changes as I change between a UTF-8 file and another non-UTF-8 file).

You are right. I just have to work with unicode files some weeks ago, but i recognized the same mistake. This setting seems to be editor global, and not independent by file to file. It is very annoying, when you have opened a unicode and a non unicode file, and to see the unicode correct, you have to change the coding to UTF-x, but then when you switch to the other file, edit that and save, that will be also stored as unicode.
Couldn't it be solved as the line ending? That works fine, even if i switch between Unix, Dos or Mac type files.
Thak you!

Options: Reply | Quote | Up ^


#8 Re: PSPad removes UTF-8 BOM at beginning of file

Posted by: pspad | Date: 03/03/2010 17:55 | IP: IP Logged

papi:
Daniel Rentz:
(so the mark changes as I change between a UTF-8 file and another non-UTF-8 file).

You are right. I just have to work with unicode files some weeks ago, but i recognized the same mistake. This setting seems to be editor global, and not independent by file to file. It is very annoying, when you have opened a unicode and a non unicode file, and to see the unicode correct, you have to change the coding to UTF-x, but then when you switch to the other file, edit that and save, that will be also stored as unicode.
Couldn't it be solved as the line ending? That works fine, even if i switch between Unix, Dos or Mac type files.
Thak you!

Important is the information on statusbar, not in the menu!
Menu is used for code page change for file or for create new file

Options: Reply | Quote | Up ^


#9 Re: PSPad removes UTF-8 BOM at beginning of file

Posted by: papi | Date: 03/03/2010 18:51 | IP: IP Logged

pspad:
Important is the information on statusbar, not in the menu!
Menu is used for code page change for file or for create new file

It seems to me that if i open an existing non unicode file (after that i set that in the menu for another file to be unicode), than it will be wrongly displayed, because it trys to read as unicode.
Maybe i am wrong, but it seems confusing, and if i don't pay high attention, my files are mixed up.

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2014 Jan Fiala
Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák