한글이 깨져나옵니다.

semjase의 이미지

[사용환경: 쿠분투 대퍼]

Windows에 있던 TXT화일을 가져왔는데 한글이 모두 깨져나옵니다.
어떻게 해야하나요?

윈도우즈, 리눅스 모두 깨지지않고 한글을 보고싶습니다.

pok의 이미지

http://kldp.org/node/69255
보시면 utf-8문제에 대한 해결책들이 있습니다.

semjase의 이미지

kate의 메뉴를 살펴보니 euckr과 utf-8 문서를 보는 옵션이 있어서 잘 볼수있었습니다.
위 링크를 보면 vim에서는 자동으로 처리해준다고하는데 전 안돼더군요.

그리고 매번 문서를 볼때마다 euckr과 utf-8을 전환해가면 봐야하는건가요?
자동으로 처리해주는 뭐 그런건 없나요?

vim에서 UTF-8과 euc-kr 한글문서를 자동으로 처리해준다는 글을 보고 해봤습니다만 역시 꺠져나옵니다.

Quote:

" vim 에서 UTF-8, euc-kr 한글문서 그냥 열기.
" {{{ Locale settings
" Try to come up with some nice sane GUI fonts. Also try to set a sensible
" value for fileencodings based upon locale. These can all be overridden in
" the user vimrc file.
"
if v:lang =~? "^ko"
set fileencodings=euc-kr
set fileencoding=euc-kr
set guifontset=-*-*-medium-r-normal--16-*-*-*-*-*-*-*
elseif v:lang =~? "^ja_JP"
set fileencodings=euc-jp
set fileencoding=euc-jp
set guifontset=-misc-fixed-medium-r-normal--14-*-*-*-*-*-*-*
elseif v:lang =~? "^zh_TW"
set fileencodings=big5
set fileencoding=big5
set guifontset=-sony-fixed-medium-r-normal--16-150-75-75-c-80-iso8859-1,-taipei-fixed-medium-r-normal--16-150-75-75-c-160-big5-0
elseif v:lang =~? "^zh_CN"
set fileencodings=gb2312
set fileencoding=gb2312
set guifontset=*-r-*
endif

" If we have a BOM, always honour that rather than trying to guess.
if &fileencodings !~? "ucs-bom"
set fileencodings^=ucs-bom
set fileencoding=ucs-bom
else
set fileencodings+=ucs-bom
endif

" Always check for UTF-8 when trying to determine encodings.
if &fileencodings !~? "utf-8"
set fileencodings^=utf-8
set fileencoding=utf-8
else
set fileencodings+=utf-8
endif

그림의 왼쪽이 .vimrc를 없애버렸을때
오른쪽이 위의 항목을 추가했을때입니다.

.

익명사용자의 이미지

"/etc/fstab" 를 편집하면 자동으로 됩니다.

semjase의 이미지

제 질문은 mount의 문제가 아니라 Windows에서 쓴 문서를 리눅스에서 깨지지않고 보는 방법에
관한것이었는데요.

현재 윈도우를 마운트하면 화일명은 깨지지않고 잘 나옵니다.

.

익명사용자의 이미지

.

pok의 이미지

.vimrc에 encoding 항목이 없네요.
vim에서는 encoding과 fileencoding이 다른개념으로 쓰입니다.
제 .vimrc 파일을 예로 들면

if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
  set encoding=utf-8
  set fileencodings=utf-8,cp949
endif

자세한 것은 vi에서 :help encoding 이나 :help fileencodings 를 참조하세요.
semjase의 이미지

님의 .vimrc파일을 추가했더니 깨지지않고 제대로 나옵니다.

한가지 더 여쭤도 될까요?

kate같은 에디터에서는 자동으로 변환하는 방법이 없을까요?
매번 메뉴에서 바꾸는 방법밖엔 없나요?

.

pok의 이미지

제가 kate는 쓰지 않아서 확답을 못드리겠느데, 구글링 해보니
http://bugs.kde.org/show_bug.cgi?id=96149
메뉴에 auto-detection이 있다는 식으로 나와있네요..
http://wiki.kde.org/tiki-index.php?page=Configuring+Kate+with+variables
에 보니 .kateconfig 라는 파일이 있고, 거기에 encoding 부분에 auto 쯤으로 하면 되지 않을까 합니다.

자세한 사항은 kate쓰시는 분들께서 직접..(....)

댓글 달기

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
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.