The @code{set-locale-environment} function normally uses the preferred coding system established by the language environment to decode system messages. But if your locale matches an entry in the variable @code{locale-preferred-coding-systems}, Emacs uses the corresponding coding system instead. For example, if the locale @samp{ja_JP.PCK} matches @code{japanese-shift-jis} in @code{locale-preferred-coding-systems}, Emacs uses that encoding even though it might normally use @code{japanese-iso-8bit}. @code{utf-8}.