Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Over the past few years there have been some Linux systems that will output strange characters when running various commands. Here's an example of my output from the sensors command on one of those machines:

acpitz-virtual-0
Adapter: Virtual device
temp1:        +45.5°C  (crit = +126.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Core 0:       +44.0°C  (high = +100.0°C, crit = +100.0°C)
Core 1:       +45.0°C  (high = +100.0°C, crit = +100.0°C)

nouveau-pci-0100
Adapter: PCI adapter
temp1:        -62.0°C  (high = +95.0°C, crit = +99.0°C)

Notice the  character all over the place. Why does this happen in some environments and not others? What can I do to correct this?

share|improve this question

2 Answers 2

up vote 7 down vote accepted

Either use a terminal program that understands UTF-8, or tell your shell to not use UTF-8 via $LANG.

>>> print u'°'.encode('utf-8').decode('latin-1')
°
share|improve this answer
1  
Thanks, I realized I hadn't set this up in Putty on Windows. That is where the problem was happening, not when using the terminal in various Linux distros. My mistake! –  Aaron Sep 18 '13 at 13:27
    
In this case PuTTY would be your terminal program. –  Ignacio Vazquez-Abrams Sep 18 '13 at 16:01
    
This worked for me. Single quotes had turned into â on PuTTY, but it was fixed after I changed the Window > Translation > Remote character set to UTF8 –  andrewtweber Jul 19 at 0:54

You should set your locale to C:

export LC_ALL=C
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.