2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-30 22:05:11 +00:00

Support UTF-8 output (Marcel Sebek, sebek64 at post dot cz).

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2254 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare
2004-01-31 11:58:06 +00:00
parent 8408e0604a
commit 2b701cc178

View File

@@ -22,6 +22,8 @@
#include <getopt.h>
#include <string.h>
#include <errno.h>
#include <locale.h>
#include <langinfo.h>
#include "lib/sensors.h"
#include "lib/error.h"
@@ -169,6 +171,8 @@ int main (int argc, char *argv[])
{ 0,0,0,0 }
};
setlocale(LC_CTYPE, "");
do_unknown = 0;
do_sets = 0;
show_algorithm = 0;
@@ -248,7 +252,10 @@ int main (int argc, char *argv[])
close_config_file();
/* build the degrees string */
sprintf(degstr, "%c", 176);
if (strcmp(nl_langinfo(CODESET), "UTF-8") == 0)
sprintf(degstr, "%c%c", 0xc2, 0xb0);
else
sprintf(degstr, "%c", 176);
if (fahrenheit) {
strcat(degstr, "F");
} else {