PsPad 4.5.4 (2351)
Win XP Pro, SP3

I have a small text file that PsPad cannot read correctly, I'll call this file
'Bad'.  When openned in PsPad, boxes are shown between each letter.  Windows
Notepad and Notepad2 open it fine, Notepad2 shows it as Unicode encoded (UTF-16
LE).

When PsPad opens the file, in the status bar it shows the format as ANSI.  If I
attempt to change the format, using Format -> UTF-16 LE, or UTF-16 BE, or UTF-8,
nothing changes.

When I open the file with Firefox 2, it too cannot display it correctly ...
showing characters between all the text.  However, if I change the character
encoding, using View -> Character Encoding -> Unicode (UTF-16 Little Endian), it
can display it properly.  (I tried this in Firefox because I learned long ago it
can be a very simple tool for trying to determine the encoding.)

After openning file 'Bad' in Windows Notepad, I saved out a copy in Unicode
encoding.  This I'll call file 'Good'.

I can open the Good file in PsPad and Firefox without any issue.  When I open it
in PsPad, it properly shows in the Status bar the encoding is UTF-16 LE.

Now, if I compare the Good and Bad file using Beyond Compare (using a Hex
comparision), the files are exactly the same except for the first two bytes. 
The Good file includes Hex codes FF and FE in the first two bytes, whereas the
bad file does not include these.

>From my understanding, these first two bytes help determine the character
encoding, which without I can see why PsPad would have problems determining the
encoding.

My questions are:

1) How can Windows Notepad and Notepad2 open the Bad file without issue, do they
just assume UTF-16 LE if the encoding is not known?

2) Why does PsPad not display correctly when I select format UTF-16 LE?

3) Can PsPad be updated to read the Bad file?

Thanks,
Jim.

-- 
<http://forum.pspad.com/read.php?4,49943,49943>
PSPad freeware editor http://www.pspad.com

Odpovedet emailem