Skip to content

Setting locale to support UTF-8

2 messages · Duncan Murdoch, Brian Ripley

#
In Sweave, if the locale is set to C, non-ASCII characters are not 
handled nicely even if I declare the encoding of the file to be "UTF-8". 
  I'm trying to find a workaround for this, because I'm using Sweave 
from within TeXShop.   TeXShop runs its typesetting engines in the C 
locale, and non-ascii characters are messed up.

Is there a way to declare that I am in a "generic" UTF-8 locale?  It is 
like the C locale in other respects, but it knows about UTF-8 characters.

Duncan Murdoch
#
On 30/11/2013 20:09, Duncan Murdoch wrote:
Locales are about more than encodings, but LC_CTYPE=en_US.UTF-8 will 
works almost everywhere.  The only place I know where it might give 
trouble is Debian which micromanages glibc and makes installation of 
locales optional.

But on a OS which supports UTF-8 locales it would be perverse not to 
have a least one UTF-8 locale installed.

(There is also the issue of .UTF-8 vs .utf8, but I think everyone 
accepts the first now.)