mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-02 03:52:49 -05:00
Fixed the printing and charset combo boxes in Unix PuTTY. (The
former by simply removing it; the latter by adding an enumeration function to libcharset.) This has had slight `const' repercussions on cp_name() and cp_enumerate() which might break the Mac build. [originally from svn r3064]
This commit is contained in:
30
unix/uxucs.c
30
unix/uxucs.c
@ -8,6 +8,7 @@
|
||||
#include <time.h>
|
||||
|
||||
#include "putty.h"
|
||||
#include "charset.h"
|
||||
#include "terminal.h"
|
||||
#include "misc.h"
|
||||
|
||||
@ -122,9 +123,7 @@ int init_ucs(struct unicode_data *ucsdata,
|
||||
* line_codepage should be decoded from the specification in
|
||||
* cfg.
|
||||
*/
|
||||
ucsdata->line_codepage = charset_from_mimeenc(linecharset);
|
||||
if (ucsdata->line_codepage == CS_NONE)
|
||||
ucsdata->line_codepage = charset_from_xenc(linecharset);
|
||||
ucsdata->line_codepage = decode_codepage(linecharset);
|
||||
|
||||
/*
|
||||
* If line_codepage is _still_ CS_NONE, we assume we're using
|
||||
@ -218,3 +217,28 @@ int init_ucs(struct unicode_data *ucsdata,
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
const char *cp_name(int codepage)
|
||||
{
|
||||
if (codepage == CS_NONE)
|
||||
return "Use font encoding";
|
||||
return charset_to_localenc(codepage);
|
||||
}
|
||||
|
||||
const char *cp_enumerate(int index)
|
||||
{
|
||||
int charset;
|
||||
if (index == 0)
|
||||
return "Use font encoding";
|
||||
charset = charset_localenc_nth(index-1);
|
||||
if (charset == CS_NONE)
|
||||
return NULL;
|
||||
return charset_to_localenc(charset);
|
||||
}
|
||||
|
||||
int decode_codepage(char *cp_name)
|
||||
{
|
||||
if (!*cp_name)
|
||||
return CS_NONE; /* use font encoding */
|
||||
return charset_from_localenc(cp_name);
|
||||
}
|
||||
|
Reference in New Issue
Block a user