Updated to include support for special characters.