[KARAF-3327] Improve LC_CTYPE parsing