When working on projects that use different character encodings I find myself constantly switching the character encoding of a terminal. In some terminals (e.g. gnome-terminal) you can create profiles for different terminals (say, profile "Project A" for the project that uses UTF-8 and profile "Project B" for the one that uses ISO-8859-1) but doing this only for switching the encoding is awkward.
在处理使用不同字符编码的项目时,我发现自己经常切换终端的字符编码。在某些终端(例如gnome-terminal)中,您可以为不同的终端创建配置文件(例如,使用UTF-8的项目的配置文件“项目A”和使用ISO-8859-1的项目的配置文件“项目B”)这样做只是为了切换编码很尴尬。
Is there a sensible way to switch the encoding automatically, e.g. using a dot-file in the project root directory or using revision control meta data?
是否有一种明智的方法可以自动切换编码,例如在项目根目录中使用点文件或使用修订控制元数据?
1 个解决方案
#1
0
It sounds like the "different profiles for different terminal environments" idea is probably your best bet. You can easily create a desktop shortcut for each profile.
听起来像“不同终端环境的不同配置文件”的想法可能是你最好的选择。您可以轻松地为每个配置文件创建桌面快捷方式。
Another (less elegant) alternative would be to create a different "env" script for each directory, then source it (e.g. ". ./env") before you start working in that session.
另一种(不那么优雅)的替代方案是为每个目录创建一个不同的“env”脚本,然后在开始在该会话中工作之前将其源(例如“./env”)。
IMHO .. PSM
恕我直言.. PSM
#1
0
It sounds like the "different profiles for different terminal environments" idea is probably your best bet. You can easily create a desktop shortcut for each profile.
听起来像“不同终端环境的不同配置文件”的想法可能是你最好的选择。您可以轻松地为每个配置文件创建桌面快捷方式。
Another (less elegant) alternative would be to create a different "env" script for each directory, then source it (e.g. ". ./env") before you start working in that session.
另一种(不那么优雅)的替代方案是为每个目录创建一个不同的“env”脚本,然后在开始在该会话中工作之前将其源(例如“./env”)。
IMHO .. PSM
恕我直言.. PSM