Correctly parse LC_CTYPE when a modifier is present

The POSIX standard says the format for LC_CTYPE is:

[language[_territory][.codeset][@modifier]]

This ensures that the modifer is removed if present when the encoding is
parsed from the LC_CTYPE environment variable.
Merge branch 'pulls/105'