if using unicode (utf-8) as locale, also make sure your data, including input and output streams match. as you might still be experiencing certain "bits" in the whole setup not being utf-8. also check your locale settings at system/root level, and compare with the logged in user. i've seen weirdness come from that. also make sure there's no special other perl only system variables set, that could interfere.