I don't have files with non-english names, and don't type non-latin URL's, so question is how to auto switch system input source in these occasions.
1 Answer
Using KeyRemap4MacBook, you could save something like this as private.xml:
<?xml version="1.0"?>
<root>
<item>
<name>test1</name>
<identifier>test1</identifier>
<only>SAFARI</only>
<autogen>__KeyToKey__ KeyCode::L, VK_COMMAND | ModifierFlag::NONE, KeyCode::L, VK_COMMAND, KeyCode::VK_CHANGE_INPUTMODE_ENGLISH</autogen>
</item>
<item>
<name>test2</name>
<identifier>test2</identifier>
<autogen>__KeyToKey__ KeyCode::SPACE, VK_COMMAND | ModifierFlag::NONE, KeyCode::SPACE, VK_COMMAND, KeyCode::VK_CHANGE_INPUTMODE_ENGLISH</autogen>
</item>
</root>
It only works with those two shortcuts and it doesn't change the input source back later though. See the source for the key code values and predefined settings.
Alfred has an option to always switch to a specific input source: