More Chinese characters support

This commit is contained in:
Michiel Broek
2005-04-03 14:12:12 +00:00
parent a1d01ff815
commit f9e170dd72
7 changed files with 55 additions and 4 deletions

View File

@@ -1052,6 +1052,8 @@ void Chg_Charset()
exitinfo.Charset = i;
Syslog('+', "New character set %s", getchrs(exitinfo.Charset));
WriteExitinfo();
setlocale(LC_CTYPE, getlocale(exitinfo.Charset));
Syslog('b', "setlocale(LC_CTYPE, NULL) returns \"%s\"", printable(setlocale(LC_CTYPE, NULL), 0));
Enter(2);
colour(LIGHTGREEN, BLACK);
/* Character set now set to: */

View File

@@ -46,8 +46,6 @@
#include "ttyio.h"
#include "openport.h"
#include <locale.h>
#include <langinfo.h>
extern int do_quiet; /* Logging quiet flag */
@@ -228,7 +226,7 @@ int main(int argc, char **argv)
/*
* Some debugging for me
*/
Syslog('b', "setlocale() returns \"%s\"", printable(setlocale(LC_ALL, NULL), 0));
Syslog('b', "setlocale(LC_ALL, NULL) returns \"%s\"", printable(setlocale(LC_ALL, NULL), 0));
/* Next is not usefull */
Syslog('b', "nl_langinfo(LC_CTYPE) returns \"%s\"", printable(nl_langinfo(LC_CTYPE), 0));

View File

@@ -219,7 +219,12 @@ void Add_Headkludges(faddr *dest, int IsReply)
break;
}
if (msgs.Charset != FTNC_NONE) {
/*
* Set the right charset kludge
*/
if (exitinfo.Charset != FTNC_NONE) {
sprintf(temp, "\001CHRS: %s", getchrs(exitinfo.Charset));
} else if (msgs.Charset != FTNC_NONE) {
sprintf(temp, "\001CHRS: %s", getchrs(msgs.Charset));
} else {
sprintf(temp, "\001CHRS: %s", getchrs(FTNC_LATIN_1));

View File

@@ -53,6 +53,7 @@
#include "ttyio.h"
extern int sock;
extern pid_t mypid;
char *StartTime = NULL;
@@ -463,6 +464,9 @@ void user()
Chg_Charset();
}
setlocale(LC_CTYPE, getlocale(exitinfo.Charset));
Syslog('b', "setlocale(LC_CTYPE, NULL) returns \"%s\"", printable(setlocale(LC_CTYPE, NULL), 0));
GetLastUser();
StartTime = xstrcpy(GetLocalHM());
ChangeHomeDir(exitinfo.Name, exitinfo.Email);