FAR in edit mode and default encoding

You have encountered a problem using Far Manager? Here you can get help.
pepak
Posts: 312
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 1 time
Been thanked: 9 times

FAR in edit mode and default encoding

Postby pepak » Tue 23 Aug, 2016 07:07

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: 2881
Joined: Mon 07 Sep, 2009 10:40
Has thanked: 2 times
Been thanked: 76 times

FAR in edit mode and default encoding

Postby 2useven10 » Tue 23 Aug, 2016 08:37

pepak wrote:Source of the post 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: 312
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 1 time
Been thanked: 9 times

FAR in edit mode and default encoding

Postby pepak » Wed 24 Aug, 2016 19:07

Too bad. It would be very useful for me :-(

User avatar
DrKnS
Posts: 4463
Joined: Thu 04 Aug, 2005 06:44
Location: Kyiv
Has thanked: 2 times
Been thanked: 105 times
Contact:

FAR in edit mode and default encoding

Postby DrKnS » Wed 24 Aug, 2016 19:27

pepak wrote:Source of the post is it possible to specify a default encoding?
It is possible: far.exe /set:Editor.DefaultCodePage=1250 /e file.txt

pepak
Posts: 312
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 1 time
Been thanked: 9 times

FAR in edit mode and default encoding

Postby pepak » Wed 24 Aug, 2016 19:33

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: 7917
Joined: Tue 30 Aug, 2005 17:21
Location: Санкт-Петербург
Has thanked: 65 times
Been thanked: 94 times

FAR in edit mode and default encoding

Postby HaRT » Wed 24 Aug, 2016 19:42

pepak wrote:Source of the post apparently this is missing from FAR's english Help
From the Russian-language one, too. :(
Фар есть инструмент, а не нянька. © 2009 DrKnS

User avatar
DrKnS
Posts: 4463
Joined: Thu 04 Aug, 2005 06:44
Location: Kyiv
Has thanked: 2 times
Been thanked: 105 times
Contact:

FAR in edit mode and default encoding

Postby DrKnS » Wed 24 Aug, 2016 19:47

Help can get out of sync indeed (fixed now), but you can always try far /? to find out all supported parameters.

Shmuel
Posts: 4956
Joined: Thu 23 Mar, 2006 21:36
Location: Israel
Has thanked: 11 times
Been thanked: 125 times

FAR in edit mode and default encoding

Postby Shmuel » Wed 24 Aug, 2016 19:50

DrKnS wrote:Source of the post fixed now
You seem to insert English description into Russian help.

2useven10
Posts: 2881
Joined: Mon 07 Sep, 2009 10:40
Has thanked: 2 times
Been thanked: 76 times

FAR in edit mode and default encoding

Postby 2useven10 » Wed 24 Aug, 2016 21:16

DrKnS wrote:Source of the post 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: 2881
Joined: Mon 07 Sep, 2009 10:40
Has thanked: 2 times
Been thanked: 76 times

FAR in edit mode and default encoding

Postby 2useven10 » Wed 24 Aug, 2016 21:35

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: 4463
Joined: Thu 04 Aug, 2005 06:44
Location: Kyiv
Has thanked: 2 times
Been thanked: 105 times
Contact:

FAR in edit mode and default encoding

Postby DrKnS » Wed 24 Aug, 2016 21:52

2useven10 wrote:Source of the post 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: 2881
Joined: Mon 07 Sep, 2009 10:40
Has thanked: 2 times
Been thanked: 76 times

FAR in edit mode and default encoding

Postby 2useven10 » Wed 24 Aug, 2016 22:03

DrKnS wrote:Source of the post The initial question is ...
You are right. I did reinterpret question before answeing it.


Return to “Support and Troubleshooting”

Who is online

Users browsing this forum: No registered users and 1 guest