• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythonwindowsphpgamebathyscaphegui翻訳comegattwitterframeworkbtronvb.net計画中(planning stage)testdomarduinodirectxpreviewerゲームエンジン

nkfのGitリポジトリのfork


Commit MetaInfo

Revisión832e032be763ec6acf1cf13225b0d72f1b867a18 (tree)
Tiempo2012-03-17 20:50:17
AutorNARUSE, Yui <naruse@user...>
CommiterNARUSE, Yui

Log Message

Show "(BOM)" if the byte sequence has BOM.

http://sourceforge.jp/ticket/browse.php?group_id=248&tid=26325

Cambiar Resumen

Diferencia incremental

--- a/nkf.c
+++ b/nkf.c
@@ -20,11 +20,11 @@
2020 *
2121 * 3. This notice may not be removed or altered from any source distribution.
2222 */
23-#define NKF_VERSION "2.1.2"
24-#define NKF_RELEASE_DATE "2011-09-08"
23+#define NKF_VERSION "2.1.3"
24+#define NKF_RELEASE_DATE "2012-03-17"
2525 #define COPY_RIGHT \
2626 "Copyright (C) 1987, FUJITSU LTD. (I.Ichikawa).\n" \
27- "Copyright (C) 1996-2011, The nkf Project."
27+ "Copyright (C) 1996-2012, The nkf Project."
2828
2929 #include "config.h"
3030 #include "nkf.h"
@@ -356,6 +356,7 @@ static int no_cp932ext_f = FALSE;
356356 /* ignore ZERO WIDTH NO-BREAK SPACE */
357357 static int no_best_fit_chars_f = FALSE;
358358 static int input_endian = ENDIAN_BIG;
359+static int input_bom_f = FALSE;
359360 static nkf_char unicode_subchar = '?'; /* the regular substitution character */
360361 static void (*encode_fallback)(nkf_char c) = NULL;
361362 static void w_status(struct input_code *, nkf_char);
@@ -3202,6 +3203,7 @@ check_bom(FILE *f)
32023203 set_iconv(TRUE, w_iconv32);
32033204 }
32043205 if (iconv == w_iconv32) {
3206+ input_bom_f = TRUE;
32053207 input_endian = ENDIAN_BIG;
32063208 return;
32073209 }
@@ -3232,6 +3234,7 @@ check_bom(FILE *f)
32323234 set_iconv(TRUE, w_iconv);
32333235 }
32343236 if (iconv == w_iconv) {
3237+ input_bom_f = TRUE;
32353238 return;
32363239 }
32373240 (*i_ungetc)(0xBF,f);
@@ -3260,6 +3263,7 @@ check_bom(FILE *f)
32603263 }
32613264 if (iconv == w_iconv16) {
32623265 input_endian = ENDIAN_BIG;
3266+ input_bom_f = TRUE;
32633267 return;
32643268 }
32653269 (*i_ungetc)(0xFF,f);
@@ -3275,6 +3279,7 @@ check_bom(FILE *f)
32753279 }
32763280 if (iconv == w_iconv32) {
32773281 input_endian = ENDIAN_LITTLE;
3282+ input_bom_f = TRUE;
32783283 return;
32793284 }
32803285 (*i_ungetc)(0x00,f);
@@ -3286,6 +3291,7 @@ check_bom(FILE *f)
32863291 }
32873292 if (iconv == w_iconv16) {
32883293 input_endian = ENDIAN_LITTLE;
3294+ input_bom_f = TRUE;
32893295 return;
32903296 }
32913297 (*i_ungetc)(0xFE,f);
@@ -4190,12 +4196,13 @@ print_guessed_code(char *filename)
41904196 if (guess_f == 1) {
41914197 printf("%s\n", input_codename);
41924198 } else {
4193- printf("%s%s%s\n",
4199+ printf("%s%s%s%s\n",
41944200 input_codename,
41954201 iconv != w_iconv16 && iconv != w_iconv32 ? "" :
41964202 input_endian == ENDIAN_LITTLE ? " LE" :
41974203 input_endian == ENDIAN_BIG ? " BE" :
41984204 "[BUG]",
4205+ input_bom_f ? " (BOM)" : "",
41994206 input_eol == CR ? " (CR)" :
42004207 input_eol == LF ? " (LF)" :
42014208 input_eol == CRLF ? " (CRLF)" :