User Tools

Site Tools


localization_and_you_-_utf_8_on_netbsd

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
localization_and_you_-_utf_8_on_netbsd [2021/04/01 04:53] – [Localization and You -- UTF–8 on NetBSD] hc9localization_and_you_-_utf_8_on_netbsd [2022/02/08 23:59] (current) – added a paragraph about lynx jquah
Line 14: Line 14:
  
 Save, kill any screen or tmux sessions or other background processes, and log out. When you log in again, you should have a proper UTF–8 terminal as far as most programs are concerned. Save, kill any screen or tmux sessions or other background processes, and log out. When you log in again, you should have a proper UTF–8 terminal as far as most programs are concerned.
 +
 +The web browser ''lynx'' doesn't like it when LC_CTYPE (as seen in ''locale'') has a UTF-8 value.  With LANG=en_US.UTF-8 in the environment, ''locale(1)'' will set LC_CTYPE to the same, and lynx will display garbage in place of the expected UTF-8 characters.  With LC_CTYPE set to another valid value in the environment, e.g., ''env LC_CTYPE=C lynx'', locale will use that, and lynx will behave.  (Note: setting LC_CTYPE to something invalid will also work, for in that case ''locale(1)'' sets LC_CTYPE to "C" as a fallback.) This quirk is peculiar to the interaction between lynx and NetBSD 9.1; it does not appear reproducible on other systems.
  
 Perl will throw the following error when invoked: Perl will throw the following error when invoked:
Line 36: Line 38:
  
 <file config add these lines> <file config add these lines>
-if [ $TERM == "rxvt-unicode" ] || [ $TERM == "rxvt-unicode-256color" ]; then+if [ "$TERM== "rxvt-unicode" ] || [ "$TERM== "rxvt-unicode-256color" ]; then
    export TERM="rxvt"    export TERM="rxvt"
 fi fi
 </file> </file>
  
-In simple terms, this tricks NetBSD into thinking your terminal is rxvt, the original program urxvt is based on. If you have a MetaArpa account, don’t worry - the MetaArray is running CentOS, which understands urxvt just fine.+In simple terms, this tricks NetBSD into thinking your terminal is rxvt, the original program urxvt is based on. However, the same volume of home directories is mounted by the OpenBSD machine //beastie//, which //does// have an entry for rxvt-unicode in its terminfo database! So if you log in to both systems on a regular basis, and on both systems you use a shell that sources ''.profile'', your OpenBSD experience might be needlessly downgraded. In that case, check that the machine you're logged into is actually NetBSD before exporting the changed value of $TERM. 
 + 
 +<file config add these lines> 
 +if [ "$TERM" == "rxvt-unicode" ] || [ "$TERM" == "rxvt-unicode-256color" ]; then 
 +      [ "$(uname)" == "NetBSD" ] && export TERM="rxvt" 
 +fi 
 +</file> 
 + 
 +(The latter code should work in any case, but it's pointless to run 'uname' on every login if you know you'll only ever be sourcing ''.profile'' from a NetBSD machine.) 
 + 
 +If you have a MetaArpa account, don’t worry - the MetaArray is running Debian, which understands urxvt just fine.
  
 ===== Escape Characters ===== ===== Escape Characters =====
localization_and_you_-_utf_8_on_netbsd.1617252822.txt.gz · Last modified: 2021/04/01 04:53 by hc9