*
* 3. This notice may not be removed or altered from any source distribution.
*/
-#define NKF_VERSION "2.1.2"
-#define NKF_RELEASE_DATE "2011-09-08"
+#define NKF_VERSION "2.1.3"
+#define NKF_RELEASE_DATE "2012-03-17"
#define COPY_RIGHT \
"Copyright (C) 1987, FUJITSU LTD. (I.Ichikawa).\n" \
- "Copyright (C) 1996-2011, The nkf Project."
+ "Copyright (C) 1996-2012, The nkf Project."
#include "config.h"
#include "nkf.h"
/* ignore ZERO WIDTH NO-BREAK SPACE */
static int no_best_fit_chars_f = FALSE;
static int input_endian = ENDIAN_BIG;
+static int input_bom_f = FALSE;
static nkf_char unicode_subchar = '?'; /* the regular substitution character */
static void (*encode_fallback)(nkf_char c) = NULL;
static void w_status(struct input_code *, nkf_char);
set_iconv(TRUE, w_iconv32);
}
if (iconv == w_iconv32) {
+ input_bom_f = TRUE;
input_endian = ENDIAN_BIG;
return;
}
set_iconv(TRUE, w_iconv);
}
if (iconv == w_iconv) {
+ input_bom_f = TRUE;
return;
}
(*i_ungetc)(0xBF,f);
}
if (iconv == w_iconv16) {
input_endian = ENDIAN_BIG;
+ input_bom_f = TRUE;
return;
}
(*i_ungetc)(0xFF,f);
}
if (iconv == w_iconv32) {
input_endian = ENDIAN_LITTLE;
+ input_bom_f = TRUE;
return;
}
(*i_ungetc)(0x00,f);
}
if (iconv == w_iconv16) {
input_endian = ENDIAN_LITTLE;
+ input_bom_f = TRUE;
return;
}
(*i_ungetc)(0xFE,f);
if (guess_f == 1) {
printf("%s\n", input_codename);
} else {
- printf("%s%s%s\n",
+ printf("%s%s%s%s\n",
input_codename,
iconv != w_iconv16 && iconv != w_iconv32 ? "" :
input_endian == ENDIAN_LITTLE ? " LE" :
input_endian == ENDIAN_BIG ? " BE" :
"[BUG]",
+ input_bom_f ? " (BOM)" : "",
input_eol == CR ? " (CR)" :
input_eol == LF ? " (LF)" :
input_eol == CRLF ? " (CRLF)" :