FAR in edit mode and default encoding

You have encountered a problem using Far Manager? Here you can get help.
Post Reply
pepak
Posts: 604
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 54 times

FAR in edit mode and default encoding

Post 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
2useven10
Posts: 5204
Joined: Mon 07 Sep, 2009 10:40
Has thanked: 18 times
Been thanked: 310 times

FAR in edit mode and default encoding

Post 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.
pepak
Posts: 604
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 54 times

FAR in edit mode and default encoding

Post by pepak »

Too bad. It would be very useful for me :-(
User avatar
DrKnS
Posts: 6114
Joined: Thu 04 Aug, 2005 06:44
Location: Kyiv
Has thanked: 12 times
Been thanked: 426 times

FAR in edit mode and default encoding

Post by DrKnS »

pepak wrote: is it possible to specify a default encoding?
It is possible: far.exe /set:Editor.DefaultCodePage=1250 /e file.txt
pepak
Posts: 604
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 54 times

FAR in edit mode and default encoding

Post by pepak »

Wonderful!!! Thanks a lot!!

I had to check and apparently this is missing from FAR's english Help ("Command line switches" section) :-(
User avatar
HaRT
Moderator
Posts: 10822
Joined: Tue 30 Aug, 2005 17:21
Has thanked: 221 times
Been thanked: 358 times

FAR in edit mode and default encoding

Post by HaRT »

pepak wrote: apparently this is missing from FAR's english Help
From the Russian-language one, too. :(
Фар есть инструмент, а не нянька. © 2009 DrKnS
User avatar
DrKnS
Posts: 6114
Joined: Thu 04 Aug, 2005 06:44
Location: Kyiv
Has thanked: 12 times
Been thanked: 426 times

FAR in edit mode and default encoding

Post by DrKnS »

Help can get out of sync indeed (fixed now), but you can always try far /? to find out all supported parameters.
Shmuel
Posts: 6819
Joined: Thu 23 Mar, 2006 21:36
Location: Israel
Has thanked: 41 times
Been thanked: 528 times

FAR in edit mode and default encoding

Post by Shmuel »

DrKnS wrote: fixed now
You seem to insert English description into Russian help.
2useven10
Posts: 5204
Joined: Mon 07 Sep, 2009 10:40
Has thanked: 18 times
Been thanked: 310 times

FAR in edit mode and default encoding

Post 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.
2useven10
Posts: 5204
Joined: Mon 07 Sep, 2009 10:40
Has thanked: 18 times
Been thanked: 310 times

FAR in edit mode and default encoding

Post 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.
User avatar
DrKnS
Posts: 6114
Joined: Thu 04 Aug, 2005 06:44
Location: Kyiv
Has thanked: 12 times
Been thanked: 426 times

FAR in edit mode and default encoding

Post 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".
2useven10
Posts: 5204
Joined: Mon 07 Sep, 2009 10:40
Has thanked: 18 times
Been thanked: 310 times

FAR in edit mode and default encoding

Post by 2useven10 »

DrKnS wrote: The initial question is ...
You are right. I did reinterpret question before answeing it.
Post Reply

Return to “Support and Troubleshooting”