views:

21

answers:

1

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.

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?

A: 

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.

IMHO .. PSM