KTUGFaq
KTUG FAQ
If you always postpone pleasure you will never have it. Quit work and play for once!
FrontPage › BOM
BOM, Byte Order Mark
¹ÙÀÌÆ®°¡ ±âº» ´ÜÀ§ÀÎ UTF-8°ú ´Þ¸® UCS-2¿Í UTF-16Àº 2 ¹ÙÀÌÆ®°¡ ±âº» ´ÜÀ§ÀÌ°í, UTF-32¿¡¼´Â 4 ¹ÙÀÌÆ®°¡ ±âº» ´ÜÀ§À̹ǷΠ¹ÙÀÌÆ® ¿·Î ¹Ù²Ü °æ¿ì ÃÖ»óÀ§ ¹ÙÀÌÆ®°¡ ¸ÕÀú ¿À´À³Ä (Big Endian) ³ªÁß¿¡ ¿À´À³Ä (Little Endian)¿¡ µû¶ó µÎ °¡Áö ´Ù¸¥ Ç¥ÇöÀÌ °¡´ÉÇÏ´Ù. ÀÌ ¼ø¼¸¦ Ç¥½ÃÇϱâ À§ÇØ ¹®¼ÀÇ ¼±µÎ¿¡ ±× À§Ä¡¿¡¼´Â ¾Æ¹«·± ±¸½ÇÀ» ÇÒ ¼ö ¾ø´Â U+FEFF (Zero Width Non-Breaking Space)¸¦ µÎ¾î¼ ¹ÙÀÌÆ® ¼ø¼¸¦ ÀÚµ¿À¸·Î ¾Ë¾Æ³»µµ·Ï ÇÒ ¼ö ÀÖ´Ù. ¿¹ÄÁ´ë, UTF-16ÀÇ Little Edian¿¡¼´Â BOMÀ» FF FE·Î ¹Ý¸é Big Edian¿¡¼´Â FE FF·Î Á÷·ÄÈÇÑ´Ù. UTF-32LE¶ó¸é FF FE 00 00ÀÌ°í, UTF-32BE¶ó¸é 00 00 FE FFÀÏ °ÍÀÌ´Ù. BOM(U+FEFF)Àº UTF-8·Î ³ªÅ¸³»¸é EF BB BFÀÌ´Ù.
UTF-16 LE | FF FE |
UTF-16 BE | FE FF |
UTF-32 LE | FF FE 00 00 |
UTF-32 BE | 00 00 FE FF |
UTF-8 | EF BB BF |
[ÆíÁý]
UTF-8 ÆíÁý±â¸¦ ÀÌ¿ëÇÑ LaTeX/Lambda ÀÛ¾÷¿¡¼ BOM ¹®Á¦ ¶
Win32ÀÇ ÀϺΠÇÁ·Î±×·¥ (Notepad, Wordpad, MS Word) µîÀº UTF-8 BOMÀ» Win 9x/ME¿¡¼ ¾²ÀÌ´Â ANSI[1] code page (Çѱ¹¾î Windows¶ó¸é codepage 949 - È®Àå ¿Ï¼ºÇü)·Î ÀÛ¼ºµÈ ÅؽºÆ® ÆÄÀÏ°ú ±¸º°Çϱâ À§ÇÑ Ç¥Áö·Î »ç¿ëÇÑ´Ù. Áï, UTF-16, UTF-32, UTF-8 BOMÀÌ ÀÖÀ¸¸é UTF-16, UTF-32, UTF-8·Î ÀνÄÇÏ°í ±×·¸Áö ¾ÊÀº °æ¿ì ANSI code page¸¦ ¾´ °ÍÀ¸·Î °£ÁÖÇÑ´Ù. XML Ç¥ÁØ¿¡¼µµ UTF-8 BOMÀ» ºñ·ÔÇÑ BOMÀ» ÀÎÄÚµù °áÁ¤À» À§ÇÑ ÇϳªÀÇ ¹æ¹ýÀ¸·Î ¸í½ÃÇÏ°í ÀÖ´Ù. ÇÏÁö¸¸, UTF-8 BOMÀº POSIX ±â¹Ý OS¿¡¼ cat file1 file2 file3 | another_program°ú °°Àº ÆÄÀÌÇÁ¸¦ ¾µ ¶§¿¡ ¹®Á¦¸¦ ÀÏÀ¸Å°¹Ç·Î ±×´ÙÁö ȯ¿µ¹ÞÁö ¸ø ÇÑ´Ù. TeX/Omega ÀÔÀå¿¡¼µµ Notepad, Wordpad µîÀÌ BOMÀ» UTF-8¿¡ ºÙÀÌ´Â °ÍÀº ±×´ÙÁö ¹Ý°¡¿î ÀÏÀÌ ¾Æ´Ï´Ù. TeX/Omega compiler´Â .tex ÆÄÀÏ ¼±µÎ¿¡ Àǹ̸¦ ¾Ë ¼ö ¾ø´Â ±ÛÀÚ°¡ ÀÖ´Â °ÍÀ¸·Î ¿©±â¹Ç·Î °æ°í¸¦ ³½´Ù. ±×³É <Enter>¸¦ Ä¡°í °Á¦ ÄÄÆÄÀÏÇÏ¸é ºó ÆäÀÌÁö°¡ óÀ½¿¡ ºÙ¾î ³ª¿Â´Ù. -- ½ÅÁ¤½Ä
----
- [1] ANSI¿Í ¾Æ¹« °ü·ÃÀÌ ¾øÁö¸¸, MS´Â ÀÌ ¿ë¾î¸¦ ¾´´Ù.
[ÆíÁý]
KTUGCollection2006°ú BOM ¶
BOM ó¸® ¹®Á¦´Â KTUGCollection2006¿¡¼ óÀ½ µµÀԵǾú´Ù. Akira Kakuto ¾¾ÀÇ W32TeXÀ» W32TeX/ko·Î Á¤ºñÇÏ´Â °úÁ¤¿¡¼ Akira ¾¾¿¡°Ô ºÎŹÇÏ¿© TeX, e-TeX, PDFTeX, Omega, AlephÀÇ ½ÇÇàÆÄÀÏÀÌ BOM ºÙÀº UTF-8 TeX ÀÔ·ÂÆÄÀÏÀ» ó¸®ÇÒ ¶§ BOMÀ» ¹«½Ã(Á¦°Å)Çϵµ·Ï ÇÏ´Â ·çƾÀ» Àû¿ëÇÏ°Ô µÇ¾ú´Ù. ±× ÈÄ, ÀÌ BOM ó¸® ·çƾÀº TeXLive 2007, 2008°ú KC2007, KC2008¿¡ À̾îÁ³´Ù.
[ÆíÁý]
BOM Á¦°Å¸¦ ±ÇÀå ¶
±×·¯¹Ç·Î ÆÄÀÏ ±³È¯ µîÀÇ ¸ñÀûÀ» À§Çؼ¶ó¸é ¿øº» ÆÄÀÏ¿¡¼ BOMÀ» Á¦°ÅÇÏ´Â °ÍÀÌ ¹Ù¶÷Á÷ÇÏ´Ù.
[ÆíÁý]
¿¡µðÅÍ¿Í BOM ¶
¾Æ·¡¾ÆÇѱÛ(ÇѱÛ2005 µî), ¸Þ¸ðÀå(NotePad), ¿öµåÆеå, UltraEdit¿¡¼´Â UTF-8·Î ÀúÀåÇϸé ÀÚµ¿À¸·Î BOMÀ» ºÙ¿©ÁØ´Ù. ¹Ý¸é Windows¿ë Yudit¿¡¼´Â Linux¿¡¼¿Í ¸¶Âù°¡Áö·Î BOMÀ» ºÙÀÌÁö ¾Ê´Â´Ù. À©µµ ¿î¿µÃ¼Á¦¿¡¼ UTF-8 ¿£ÄÚµùÀ¸·Î LaTeX ¹®¼¸¦ ¸¸µå´Â »ç¶÷µéÀº BOM ¹®Á¦¸¦ ½º½º·Î ó¸®ÇÏ¿©¾ß ÇÒ °ÍÀÌ´Ù.
UTF-8¿¡¼ BOMÀÌ ¹Ýµå½Ã ÇÊ¿äÇÑ°¡´Â Àǹ®ÀÌ´Ù. ¾ø¾îµµ ÁÁÀ» µí. NotePad³ª UltraEditÀ¸·Î À¯´ÏÄÚµå .tex ¼Ò½º¸¦ ÆíÁýÇÑ °æ¿ì¶ó¸é À¯´ÏÄÚµå(UTF-16)·Î ÀúÀåÇÑ ´ÙÀ½ libiconv¸¦ ÀÌ¿ëÇؼ UTF-8·Î º¯È¯ÇÏ¸é ±ÍÂúÀº UTF-8 BOMÀ» Á¦°ÅÇØÁØ´Ù.
À§¿¡¼ ÀûÀº ¹Ù¿Í °°ÀÌ º° ÇÊ¿ä°¡ ¾ø°í, Â¥Áõ³³´Ï´Ù. ¹Ý¸é¿¡ ÀÎÄÚµùÀ» ÀÚµ¿À¸·Î ¾Ë¾Æ³»´Âµ¥¿¡ À¯¿ëÇϱâ´Â ÇÕ´Ï´Ù. Perl·Î´Â ´ÙÀ½°ú °°ÀÌ Çؼ Á¦°ÅÇÒ ¼ö ÀÖ½À´Ï´Ù. (Perl Unicode list¿¡ ¿Ã¶ó¿Â °ÍÀÔ´Ï´Ù.)
#!/usr/bin/perl -pi~ -0777 # program to remove a leading [UTF-8] BOM from a file # works both STDIN -> STDOUT and on the spot (with filename as argument) if ($] > 5.007) { require Encode; Encode::_utf8_off($_); } s/^\xEF\xBB\xBF//s;´Ù¸¥ ¹æ¹ýµµ ÀÖ½À´Ï´Ù (PerlÀ̹ǷΠ¾ó¸¶µçÁö ´Ù¸¥ ½ÄÀ¸·Î ÇÒ ¼ö ÀÖÁö¿ä.) -- ½ÅÁ¤½Ä
[ÆíÁý]
UltraEditÀÇ °æ¿ì ¶
´ÙÀ½ ¿É¼ÇÀ» %SystemRoot%\UEdit32.INI¿¡ ³Ö¾îÁÖ¸é, BOM ¾øÀÌ ÀúÀåÇÒ ¼ö ÀÖ´Ù
UltraEditÀÇ °æ¿ì, Advanced -> General ¿¡¼ BOM Á¦°Å ¼±Åÿ©ºÎ¸¦ ÁöÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.
Write UTF-8 BOM = 0 Write UTF-8 BOM NF = 0ù ÁÙÀº ±âÁ¸ ÆÄÀÏÀ» UTF-8·Î ÀúÀåÇßÀ» ¶§, BOMÀ» ºÙÀÏ °ÍÀΰ¡¸¦ ÁöÁ¤Çϸç, µÎ¹ø° ÁÙÀº »õ ÆÄÀÏÀ» UTF-8À» »ç¿ëÇÏ¿© ¸¸µé¾úÀ» ¶§, BOMÀ» ºÙÀÏ °ÍÀÎÁö ÁöÁ¤ÇÑ´Ù. (0ÀÌ ºÙÀÌÁö ¾ÊÀ½, 1ÀÌ ºÙÀÓ)
[ÆíÁý]
EditPlus ¶
EditPlusÀÇ °æ¿ì´Â ±âº»¼³Á¤ÀÌ 'BOM Á¦°Å'ÀÔ´Ï´Ù. -- ȲÀçÈÆ
2008.12.20
À̰Ͷ§¹®¿¡ º¸¸§À» ²þ²þ´ò½À´Ï´Ù.¤Ì¤Ì
EDIT+ 3 À» »ç¿ëÇϴµ¥, ±âº»¼³Á¤>ÆÄÀÏ¿¡¼ UTF-8 ½Äº°±âÈ£ ¸Þ´º¿¡¼ ¼±Åð¡´ÉÇÏ´õ±º¿ä.
Ç×»ó ½Äº°±âÈ£ Á¦°Å·Î Çϼžß.. -- Kailey