diff options
author | Karl Ramm <kcr@mit.edu> | 2009-03-22 04:45:28 +0000 |
---|---|---|
committer | Karl Ramm <kcr@mit.edu> | 2009-03-22 04:45:28 +0000 |
commit | 58075ad67cac57be6a06682c1cc4f1ced05c57d2 (patch) | |
tree | b8e92c56fbe5a15c06c419980bb6a1e212e73564 /clients | |
parent | 1b36ca3fc669ccbfeef7b3901531710998db9113 (diff) |
specify charset
Diffstat (limited to 'clients')
-rw-r--r-- | clients/zaway/zaway.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/clients/zaway/zaway.c b/clients/zaway/zaway.c index 67ff10a..a2a82f0 100644 --- a/clients/zaway/zaway.c +++ b/clients/zaway/zaway.c @@ -53,6 +53,9 @@ main(int argc, char *cmdline_msg; int nlocs; char *find_message(ZNotice_t *, FILE *); + char *charset = NULL; + unsigned short zcharset; + #ifdef _POSIX_VERSION struct sigaction sa; #endif @@ -74,7 +77,7 @@ main(int argc, cmdline_msg = 0; watch_location = 0; - while ((optchar = getopt(argc, argv, "m:wh")) != EOF) { + while ((optchar = getopt(argc, argv, "m:whx:")) != EOF) { switch (optchar) { case 'm': cmdline_msg = optarg; @@ -88,6 +91,10 @@ main(int argc, usage(argv[0]); return 0; + case 'x': + charset = optarg; + break; + case '?': fprintf(stderr, "Unrecognized option '-%c'.\n" @@ -97,6 +104,8 @@ main(int argc, } } + zcharset = ZGetCharset(charset); + if (argc > optind) (void) strcpy(awayfile,argv[optind]); else { @@ -190,6 +199,7 @@ main(int argc, notice.z_sender = 0; notice.z_default_format = ""; notice.z_opcode = RESPONSE_OPCODE; + notice.z_charset = zcharset; msg[0] = "Automated reply:"; msg[1] = ptr; |