Page 1 of 1

FAR in edit mode and default encoding

Posted: Tue 23 Aug, 2016 07:07
by pepak
Hi!

When running FAR in Edit mode (far /e file.txt), is it possible to specify a default encoding? I can set the default codepage in Options/Editor Settings, but that applies to all FAR windows and I only want to override it for some specific far /e calls.

Pepak

FAR in edit mode and default encoding

Posted: Tue 23 Aug, 2016 08:37
by 2useven10
pepak wrote: is it possible to specify a default encoding?
No. It is impossible now.
CP_DEFAULT (last used file codepage -> autodetection -> default configured codepage) is hardcoded.

FAR in edit mode and default encoding

Posted: Wed 24 Aug, 2016 19:07
by pepak
Too bad. It would be very useful for me :-(

FAR in edit mode and default encoding

Posted: Wed 24 Aug, 2016 19:27
by DrKnS
pepak wrote: is it possible to specify a default encoding?
It is possible: far.exe /set:Editor.DefaultCodePage=1250 /e file.txt

FAR in edit mode and default encoding

Posted: Wed 24 Aug, 2016 19:33
by pepak
Wonderful!!! Thanks a lot!!

I had to check and apparently this is missing from FAR's english Help ("Command line switches" section) :-(

FAR in edit mode and default encoding

Posted: Wed 24 Aug, 2016 19:42
by HaRT
pepak wrote: apparently this is missing from FAR's english Help
From the Russian-language one, too. :(

FAR in edit mode and default encoding

Posted: Wed 24 Aug, 2016 19:47
by DrKnS
Help can get out of sync indeed (fixed now), but you can always try far /? to find out all supported parameters.

FAR in edit mode and default encoding

Posted: Wed 24 Aug, 2016 19:50
by Shmuel
DrKnS wrote: fixed now
You seem to insert English description into Russian help.

FAR in edit mode and default encoding

Posted: Wed 24 Aug, 2016 21:16
by 2useven10
DrKnS wrote: It is possible: far.exe /set:Editor.DefaultCodePage=1250 /e file.txt
It has no effect if file codepage history exists or autodetection succeded.

FAR in edit mode and default encoding

Posted: Wed 24 Aug, 2016 21:35
by 2useven10
Probably it is possible to disable using editor file history and autodetection with another /set:xxx options.
But anyway it will be too complicated. Dedicated command line option /cp:NNNN looks much more natural.

FAR in edit mode and default encoding

Posted: Wed 24 Aug, 2016 21:52
by DrKnS
2useven10 wrote: It has no effect if file codepage history exists or autodetection succeded.
The initial question is "is it possible to specify a default encoding", not "is it possible to force an encoding".

FAR in edit mode and default encoding

Posted: Wed 24 Aug, 2016 22:03
by 2useven10
DrKnS wrote: The initial question is ...
You are right. I did reinterpret question before answeing it.