[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Strange behaviour with accented characters



Stephen Gran <steve@lobefin.net> writes:

> This one time, at band camp, Jorge Santos said:
> > Hello, when I do a 'su -' to root I get '?' instead of accented
> > characters when doing, for example an 'ls'.  This only happens with
> > 'su -', not with regular logins nor with 'su' (without the '-'), it
> > also appear to be independent of the shell used and the terminal
> > emulator used (it also happens in the console).
> > 
> > Any ideas why this may be?
> 
> Presumably you have locale settings in your .bashrc, or .bash_profile.
> When you su (no -), you get a root shell that inherits the environment
> that spawned it, so your $PATH and environment stay the same.
> 
> When you su - root, you get a brand new root shell, that only sources
> .profile and others in the /root directory.  I assume root doesn't have
> those same locale settings.
> 

That's right, I was forgetting to export the LANG variable so
everything was using the POSIX locale.

Thanks a lot!

jorge



Reply to: