Георгий Потапов via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: Hi Georgij, > I edit my files in cp1251 encoding. > > This works fine on local host but when I save files on remote host > using tramp it resets encoding to utf-8 constantly. Thanks for the report. I could reproduce the problem locally. It took me a while for debugging, but finally I could fix it. It was a stupid scoping error when changing something between Emacs 28 and Emacs 29. The fix, which works for me, is appended. It is a little bit tricky to install the patch, because it is in a defmacro of tramp.el. This macro is used in tramp-sh.el. You must compile both files in this order. Could you pls check? Best regards, Michael.