Far3 Internal Editor - Codepage auto-detection

You have encountered a problem using Far Manager? Here you can get help.
Post Reply
zb!
Posts: 20
Joined: Wed 26 Aug, 2009 15:20
Has thanked: 4 times
Been thanked: 4 times

Far3 Internal Editor - Codepage auto-detection

Post by zb! »

Hello all,

I have a question about Far3's automatic codepage detection: Is there a way to completely turn it off? I'd like the editor behave like Far2's and just display everything as ANSI (e.g. to see Unicode BOMs). Turning off codepage autodetection and setting the default codepage to ANSI (both in the editor settings) did not work.

Cheers,
zb!
Shmuel
Posts: 6819
Joined: Thu 23 Mar, 2006 21:36
Location: Israel
Has thanked: 41 times
Been thanked: 528 times

Re: Far3 Internal Editor - Codepage auto-detection

Post by Shmuel »

zb! wrote:(e.g. to see Unicode BOMs)
I've no answer to the main question. With regards to BOMs, there are 2 methods I use:

1. If I just want to know whether the BOM is present I press ShiftF2 and observe the checkbox
[ ] Add signature (BOM)
If it is checked then the BOM is present.

2. Open the file in Viewer (or press F6 when in Editor), then switch to hex mode (press F4). Then you are able to see the BOM if it is present.
zb!
Posts: 20
Joined: Wed 26 Aug, 2009 15:20
Has thanked: 4 times
Been thanked: 4 times

Re: Far3 Internal Editor - Codepage auto-detection

Post by zb! »

Thanks for those suggestions, I was only aware of the second one.

The thing is: My intent to have to editor display what actually is in the file and not interpret anything. I also would have thought that this is the purpose of the "Autodetect code page" and "Default code page" settings - do I understand that wrong?
Shmuel
Posts: 6819
Joined: Thu 23 Mar, 2006 21:36
Location: Israel
Has thanked: 41 times
Been thanked: 528 times

Re: Far3 Internal Editor - Codepage auto-detection

Post by Shmuel »

zb! wrote:My intent to have to editor display what actually is in the file and not interpret anything.
I think it is not always possible in Far 3, there is no "raw" mode in the editor. If you can switch via ShiftF8 to any 1-byte encoding (e.g. code page 437), you get it. But if the editor issues a warning then saving the file will corrupt its contents.
zb!
Posts: 20
Joined: Wed 26 Aug, 2009 15:20
Has thanked: 4 times
Been thanked: 4 times

Re: Far3 Internal Editor - Codepage auto-detection

Post by zb! »

Shmuel wrote:I think it is not always possible in Far 3, there is no "raw" mode in the editor.
That would be really unfortunate. What is it supposed to mean if i setup the editor like this, then?

Image
User avatar
John Doe
Бюрократ
Posts: 13807
Joined: Wed 27 Apr, 2005 20:42
Has thanked: 73 times
Been thanked: 426 times
Contact:

Re: Far3 Internal Editor - Codepage auto-detection

Post by John Doe »

AFAIK there are 2 separate autodetection stages:
1. Check if file has BOM. If BOM is found then file supposed to be unicode. If not then goto stage 2
2. Heuristic codepage detection (mozilla UCD)

Only 2st stage is optional.

But it is still possible to avoid 1st stage:
- press ShiftF4 to open "Open/create file" dialog.
- press ShiftEnter to insert current filename
- select ANSI from "Code page" combobox
Even more: you can record keyboard macro to automate all these actions.
Post Reply

Return to “Support and Troubleshooting”