diff -ur nano-1.3.5/src/global.c nano-1.3.5-fixed/src/global.c --- nano-1.3.5/src/global.c 2004-11-22 20:59:18.000000000 -0500 +++ nano-1.3.5-fixed/src/global.c 2004-11-27 11:43:00.000000000 -0500 @@ -1075,15 +1075,17 @@ #ifndef DISABLE_MOUSE toggle_init_one(TOGGLE_MOUSE_KEY, N_("Mouse support"), USE_MOUSE); #endif - /* If we're using restricted mode, the no-conversion and backup - * backup toggles are disabled. The former is useless since - * inserting files is disabled, and the latter is useless since - * backups are disabled. */ - if (!ISSET(RESTRICTED)) { + /* If we're using restricted mode, the DOS/Mac conversion toggle is + * disabled. It's useless since inserting files is disabled. */ + if (!ISSET(RESTRICTED)) toggle_init_one(TOGGLE_NOCONVERT_KEY, N_("No conversion from DOS/Mac format"), NO_CONVERT); + toggle_init_one(TOGGLE_NOUTF8_KEY, + N_("No conversion from UTF-8 format"), NO_UTF8); + /* If we're using restricted mode, the backup toggle is disabled. + * It's useless since backups are disabled. */ + if (!ISSET(RESTRICTED)) toggle_init_one(TOGGLE_BACKUP_KEY, N_("Backup files"), BACKUP_FILE); - } toggle_init_one(TOGGLE_SMOOTH_KEY, N_("Smooth scrolling"), SMOOTHSCROLL); toggle_init_one(TOGGLE_SMARTHOME_KEY, N_("Smart home key"), SMART_HOME); #ifdef ENABLE_COLOR diff -ur nano-1.3.5/src/nano.c nano-1.3.5-fixed/src/nano.c --- nano-1.3.5/src/nano.c 2004-11-22 20:59:18.000000000 -0500 +++ nano-1.3.5-fixed/src/nano.c 2004-11-27 11:43:00.000000000 -0500 @@ -3313,9 +3313,9 @@ while ((optchr = #ifdef HAVE_GETOPT_LONG - getopt_long(argc, argv, "h?ABE:FHINQ:RST:VY:Zabcdefgijklmo:pr:s:tvwxz", long_options, NULL) + getopt_long(argc, argv, "h?ABE:FHINOQ:RST:VY:Zabcdefgijklmo:pr:s:tvwxz", long_options, NULL) #else - getopt(argc, argv, "h?ABE:FHINQ:RST:VY:Zabcdefgijklmo:pr:s:tvwxz") + getopt(argc, argv, "h?ABE:FHINOQ:RST:VY:Zabcdefgijklmo:pr:s:tvwxz") #endif ) != -1) { @@ -3359,6 +3359,9 @@ SET(NO_CONVERT); break; #endif + case 'O': + SET(NO_UTF8); + break; #ifndef DISABLE_JUSTIFY case 'Q': quotestr = mallocstrcpy(quotestr, optarg); diff -ur nano-1.3.5/src/nano.h nano-1.3.5-fixed/src/nano.h --- nano-1.3.5/src/nano.h 2004-11-08 23:08:48.000000000 -0500 +++ nano-1.3.5-fixed/src/nano.h 2004-11-27 11:43:00.000000000 -0500 @@ -324,6 +324,7 @@ #define RESTRICTED (1<<26) #define SMART_HOME (1<<27) #define WHITESPACE_DISPLAY (1<<28) +#define NO_UTF8 (1<<29) /* Control key sequences, changing these would be very very bad. */ #define NANO_CONTROL_SPACE 0 @@ -508,6 +509,7 @@ #define TOGGLE_SYNTAX_KEY NANO_ALT_Y #define TOGGLE_SMARTHOME_KEY NANO_ALT_H #define TOGGLE_WHITESPACE_KEY NANO_ALT_P +#define TOGGLE_NOUTF8_KEY NANO_ALT_O #endif /* !NANO_SMALL */ #define MAIN_VISIBLE 12 diff -ur nano-1.3.5/src/rcfile.c nano-1.3.5-fixed/src/rcfile.c --- nano-1.3.5/src/rcfile.c 2004-11-22 20:59:18.000000000 -0500 +++ nano-1.3.5-fixed/src/rcfile.c 2004-11-27 11:43:00.000000000 -0500 @@ -68,6 +68,7 @@ #endif {"nofollow", NOFOLLOW_SYMLINKS}, {"nohelp", NO_HELP}, + {"noutf8", NO_UTF8}, #ifndef DISABLE_WRAPPING {"nowrap", NO_WRAP}, #endif diff -ur nano-1.3.5/src/winio.c nano-1.3.5-fixed/src/winio.c --- nano-1.3.5/src/winio.c 2004-11-22 20:59:18.000000000 -0500 +++ nano-1.3.5-fixed/src/winio.c 2004-11-27 11:43:00.000000000 -0500 @@ -221,8 +221,9 @@ retval = sequence[0]; } } - /* Handle UTF-8 sequences. */ - } else if (seq == UTF8_SEQ) { + /* Handle UTF-8 sequences if UTF-8 conversion isn't + * disabled. */ + } else if (!ISSET(NO_UTF8) && seq == UTF8_SEQ) { /* If we have a UTF-8 sequence, translate the UTF-8 * sequence into the corresponding wide character value, * and save that as the result. */ @@ -263,7 +264,8 @@ /* Translate acceptable ASCII, extended keypad values, and escape and * UTF-8 sequences into their corresponding key values. Set seq to * ESCAPE_SEQ when we get an escape sequence, or UTF8_SEQ when we get a - * UTF-8 sequence. Assume nodelay(win) is FALSE. */ + * UTF-8 sequence (if UTF-8 conversion isn't disabled). Assume + * nodelay(win) is FALSE. */ int get_translated_kbinput(int kbinput, seq_type *seq #ifndef NANO_SMALL , bool reset @@ -493,8 +495,9 @@ } /* A character other than ERR with its high bit set: UTF-8 sequence - * mode. Set seq to UTF8_SEQ. */ - if (retval != ERR && 127 < retval && retval <= 255) + * mode. Set seq to UTF8_SEQ if UTF-8 conversion isn't disabled. */ + if (retval != ERR && !ISSET(NO_UTF8) && 127 < retval && + retval <= 255) *seq = UTF8_SEQ; #ifdef DEBUG