You are here: PSPad forum > Bug report / Hlášení chyb > Save ANSI file as UTF-8 doesn't work

Save ANSI file as UTF-8 doesn't work

Goto Page: 1 2 3 Next

#1 Save ANSI file as UTF-8 doesn't work

Posted by: berny | Date: 2008-02-29 13:59 | IP: IP Logged

Hello,

This refers to latest PsPad version 4.5.3 (2298).
I have an ANSI file created in Notepad.
When I open it in PsPad it uses the default setting UTF-8 there. When I save it again however it's not stored in UTF-8! This is not expected behaviour.
Would be good too, if the current storage format including Byte order Mark could be shown in File information.

Best Regards,
Berny

Options: Reply | Quote | Up ^


#2 Re: Save ANSI file as UTF-8 doesn't work

Posted by: berny | Date: 2008-02-29 14:03 | IP: IP Logged

Hi,
some more info on this:

Only when saving it in ANSI first and then UTF-8 again, it gets really stored in UTF-8 format.

Best Regards,
Berny

Options: Reply | Quote | Up ^


#3 Re: Save ANSI file as UTF-8 doesn't work

Posted by: vbr | Date: 2008-02-29 21:32 | IP: IP Logged

There are multiple Codepage settings in PSPad -
Menu: Format ... sets the encoding for newly crated and possibly open files (it doesn't have to be the same like the encoding of the active file - this is shown on the statusbar)
In many cases the encoding cannot be determined from the textfile itself, PSPad sometimes tries to "guess" the correct one - if it doesn't work well, you can set the codepage manually and reopen the file.
However in some cases the given codepage can be excluded as inappropriate (e.g. if utf-8 is suplied but the file doesn't follow its scheme) - PSPad than uses some kind of fallback in order to display at least some text.

The content of the file is also important - if it contains only asci (basic latin characters etc., the file is exactly the same in utf-8 as well as ansi.

Additionally, if you have
Settings :: Files and dirs: [x] Remember file state
checked, the editor also remembers the encoding previously used for the given file.

Maybe some of those aspects can cause your problems.

Options: Reply | Quote | Up ^


#4 Re: Save ANSI file as UTF-8 doesn't work

Posted by: berny | Date: 2008-03-01 04:56 | IP: IP Logged

Thank you vbr for your detailed explanation.
Makes things a lot clearer now for me.
Berny

Options: Reply | Quote | Up ^


#5 Re: Save ANSI file as UTF-8 doesn't work

Posted by: jmb10 | Date: 2008-03-01 14:57 | IP: IP Logged

Hello,
I just downloaded PSPad for testing -seems to be a nice program- but I have a similar problem, so I step into this conversation.
UTF-8 is not properly recognized, even when the BOM is there, PSPad opens the file as Windows ANSI.
I set default file format to UTF, removed auto check of file format, and file state.
One good way of testing is as follows:
Open the wikipedia home page in your browser (www.wikipedia.org). It is an UTF-8 page with a lot of languages glyphs in it.
View source in Notepad, everything is OK. If you use PsPad instead, the source is seen as Windows ANSI (and BOM characters -  - appear at the beginning of the file).

Options: Reply | Quote | Up ^


#6 Re: Save ANSI file as UTF-8 doesn't work

Posted by: pspad | Date: 2008-03-01 15:33 | IP: IP Logged

Differences between ANS and UTF is only if file contains chars with ASCII vaule over 127.
If no char is included, there is no difference between ANSI and UTF and no reason why (and how) PSPad should open this file as UTF-8

Options: Reply | Quote | Up ^


#7 Re: Save ANSI file as UTF-8 doesn't work

Posted by: jmb10 | Date: 2008-03-03 14:13 | IP: IP Logged

That is right, but in the wikipedia homepage, there are lot of characters that are not ansi, so PSPad should have plenty of reasons to make a difference with ANSI!
Also, when there is a BOM on a UTF page, PSPad displays the BOM and consider the BOM as simple ansi characters.
This is not proper behaviour.
PSPad does a very good job, as long as you stick to a single language (ANSI code).

Options: Reply | Quote | Up ^


#8 Re: Save ANSI file as UTF-8 doesn't work

Posted by: pspad | Date: 2008-03-03 17:26 | IP: IP Logged

If file contains BOM or UTF-8 with some UTF-8 encoded characters, PSPad is able to detect it.

If PSPad opens UTF-8 file as ANSI, it's mean your file isn't correct.

Options: Reply | Quote | Up ^


#9 Re: Save ANSI file as UTF-8 doesn't work

Posted by: jmb10 | Date: 2008-03-04 14:54 | IP: IP Logged

You should probably say that to the wikipedia team!
Did you even try to open the source of web page www.wikipedia.org before answering?
(use notepad.exe, then pspad and see!)

Options: Reply | Quote | Up ^


#10 Re: Save ANSI file as UTF-8 doesn't work

Posted by: pspad | Date: 2008-03-04 15:29 | IP: IP Logged

When I Open Wikipedia.org html page, I see same content as in the notepad.
I try to view this page in TotalCommander viewer with UTF-8 and same content.
I don't understand, when you argument with wikipeda.org page...

Did you try to write some page with accented chars (or cyrilic, arabic e.t.c.), save it as UTF-8 without BOM and open in the PSPad?

Options: Reply | Quote | Up ^


Goto Page: 1 2 3 Next





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