윈도우즈와 리눅스에서 이맥스를 쓸 때 한글 깨지는 문제

dl3zp3의 이미지

윈도우즈 이맥스에서 한글을 섞어서 작성하면 리눅스 이맥스에서는 깨져서 보입니다.
그리고 리눅스 이맥스에서 한글을 섞어서 작성하면 마찬가지로 윈도우즈 이맥스에서 깨져서 나옵니다. 그런데 윈도우즈 이맥스에서는 깨져서 보여도 메모장으로 열면 잘 보입니다....

describe coding system에 의하면 윈도우즈 이맥스에서 한글섞으면 korean-iso-8bit-dos로 저장되고, 리눅스 이맥스에서는 utf-8-unix로 저장됩니다.

윈도우즈에서 문서 작성할 때도 있고, 리눅스에서 할 때도 있고, 동기화프로그램으로 문서를 교환하면서 왔다갔다하는데, 자꾸 깨지니까 불편합니다. 어떻게 해결하는 게 좋을까요? 인코딩을 통일하는 설정을 해줘야할 것 같긴 한데, grep으로 한국어단어검색하는 것도 제대로 되게 하려면 어느쪽으로 통일해야될지 모르겠습니다.

cinsk의 이미지

먼저, 인코딩을 무엇으로 할 지 결정해야 할 것 같네요.

메모장 등 Windows app에서 볼 수 있게 하려면 korean-cp949-dos 정도가 좋을 것 같고,
그게 아니라면 utf-8 정도가 좋을 것 같네요.

그리고 양쪽 Emacs script에서

(prefer-coding-system 'utf-8)
;; 또는
(prefer-coding-system 'korean-cp949-dos)

정도를 부르면 해결되지 않을까 합니다.

--
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
Korean Ver: http://www.cinsk.org/cfaqs/

dl3zp3의 이미지

리눅스에서 grep으로 한글단어를 검색 테스트를 해봤는데 utf-8만 되는 걸로 봐서 utf-8로 통일하는 게 좋은 것 같습니다.

$ grep -e fox *
#hangultext2.txt#:Brown fox jumps over a lazy dog.
hangultext2.txt:Brown fox jumps over a lazy dog.
hangultext.txt:Brown fox jumps over a lazy dog.
hangultextW.txt:Brown fox jumps over a lazy dog.
hangultextW.txt~:Brown fox jumps over a lazy dog.
 
$ grep -e 꽃이 *
hangultext2.txt:무궁화 꽃이 피었습니다
hangultext.txt:무궁화 꽃이 피었습니다.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.