You are here: PSPad forum > English discussion forum > Understanding hex view alternatives

Understanding hex view alternatives

#1 Understanding hex view alternatives

Posted by: XSven | Date: 2016-12-31 17:33 | IP: IP Logged

I am running PSPad 4.6.1 (2730) on a Lenovo notebook L560 with Windows 10. I
have created a file that contain a single character

LATIN CAPITAL LETTER A WITH DIAERESIS (U+00C4)
www.fileformat.info

The PSPad status bar shows

item 6 == Ä 196 $00C4
item 7 == Text
item 8 == UNIX
item 9 == Kodierung: UTF-8

I have used

View Menu -> Hex Edit Mode
(Switches between Hex and normal edit modes.)

to switch to hex mode. I am getting

FF FE C4 00

FF FE == BOM UTF-16 (LE)
C4 00 == LATIN CAPITAL LETTER A WITH DIAERESIS UTF-16 (LE)

I have expected

EF BB BF == BOM UTF-8
C3 84 == LATIN CAPITAL LETTER A WITH DIAERESIS UTF-8

I am almost (except the UTF-8 BOM) getting the expected RAW(!) hex view, if I
am opening the file using

File Menu -> Open in HEX Editor...
(Opens selected file directly in HEX editor. You may open any file in the HEX editor, even binaries. Warning: You can ruin an .EXE or .DLL file with one bad character if you don't know what you are doing!)

Could somebody please explain the motivation behind these 2 hex view
alternatives

View Menu -> Hex Edit Mode
File Menu -> Open in HEX Editor...

? How can I SWITCH(!) for a file that is already open to the "Open in HEX Editor"
hex view?

My apologies, if this topic was already discussed in another thread. Please let
me know the subject of it.

Kind regards
Sven

Options: Reply | Quote | Up ^


#2 Re: Understanding hex view alternatives

Posted by: pspad | Date: 2016-12-31 18:37 | IP: IP Logged

When you open file directly in HEX editor, you will see content as is on the disk. If file include BOM, you will see BOM.

When you open file as text, there is made conversion from any format to UTF-16. Switch from text to HEX will show you memory content - you will see always UTF-16 representation.

Options: Reply | Quote | Up ^


#3 Re: Understanding hex view alternatives

Posted by: XSven | Date: 2017-01-01 17:49 | IP: IP Logged

Thanks for the fast response.

OK, understood your statement about the HEX view on a file read from disk.

I didn't understand your second sentence. What do you mean with "any format"? Do you mean "any encoding"? If yes your statement seems to be questionable because the PSPad HEX view of a file depends on how the file was encoded. If I save my single character file in ANSI, open it and switch to the HEX view I don't see the in memory UTF-16 double byte representation.

Options: Reply | Quote | Up ^


#4 Re: Understanding hex view alternatives

Posted by: pspad | Date: 2017-01-01 19:31 | IP: IP Logged

You are right, I meant any encoding.

Options: Reply | Quote | Up ^






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