improved locale handling