[완료]vi 에서 한글 깨짐

[attachment=0:21wbq8ch]Screenshot.png[/attachment:21wbq8ch]
위 스크린샷 처럼 한글이 깨져나옵니다…

vi /etc/sysconfig/i18n <- 이거는 sysconfig라는 폴더도 없고 i18n이라는 파일도 없어서 못했봤어요.

LANG="ko_KR.eucKR"
SUPPORTED="ko_KR.eucKR:ko_KR:ko:en_US:en"
SYSFONT="lat0-sun16"
SYSFONTACM="iso01"


/etc/profile 파일 맨밑에 export LANG=ko 추가하시고

source profile 해서 profile을 새로 읽으시면 아마도 한글이 안 깨지실 겁니다.

-> 시도는 해봤으나 해결 되지않았어요…

다른 방법이 있으면 알려주세요.


.vimrc 내용

[code:21wbq8ch]if v:lang =~ "^ko"
set fileencodings=euc-kr
set guifontset=---medium-r-normal–16-------*
elseif v:lang =~ "^ja_JP"
set fileencodings=euc-jp
set guifontset=-misc-fixed-medium-r-normal–14-------*
elseif v:lang =~ "^zh_TW"
set fileencodings=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 guifontset=-r-
endif
if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
set fileencodings=utf-8,latin1
endif

set nocompatible " Use Vim defaults (much better!)
set bs=2 " allow backspacing over everything in insert mode
"set ai " always set autoindenting on
"set backup " keep a backup file
set viminfo='20,&quot;50 " read/write a .viminfo file, don’t store more
" than 50 lines of registers
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time

set autoindent
set cindent
set smartindent
set tabstop=4
set shiftwidth=4
set incsearch
set showmatch
set showcmd
set novisualbell
set ignorecase
set nu

set background=dark
filetype on
set enc=euc-kr
set hlsearch

if has("syntax")
syntax on
endif

"hi Statement ctermfg=Yellow
"hi String ctermfg=LightGreen

colorscheme evening

" Only do this part when compiled with support for autocommands
if has("autocmd")
" In text files, always limit the width of text to 78 characters
autocmd BufRead *.txt set tw=78
" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if line("‘&quot;") > 0 && line ("’&quot;") <= line("$") |
\ exe "normal g’&quot;" |
\ endif
endif

" Don’t use Ex mode, use Q for formatting
map Q gq

" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
endif

if &term=="xterm"
set t_Co=8
set t_Sb=^[4%dm
set t_Sf=^[3%dm
endif

" some extra commands for HTML editing
nmap ,mh wbgueyei<<ESC>ea></<ESC>pa><ESC>bba
nmap ,h1 _i<h1><ESC>A</h1><ESC>
nmap ,h2 _i<h2><ESC>A</h2><ESC>
nmap ,h3 _i<h3><ESC>A</h3><ESC>
nmap ,h4 _i<h4><ESC>A</h4><ESC>
nmap ,h5 _i<h5><ESC>A</h5><ESC>
nmap ,h6 _i<h6><ESC>A</h6><ESC>
nmap ,hb wbi<b><ESC>ea</b><ESC>bb
nmap ,he wbi<em><ESC>ea</em><ESC>bb
nmap ,hi wbi<i><ESC>ea</i><ESC>bb
nmap ,hu wbi<u><ESC>ea</i><ESC>bb
nmap ,hs wbi<strong><ESC>ea</strong><ESC>bb
nmap ,ht wbi<tt><ESC>ea</tt><ESC>bb
nmap ,hx wbF<df>f<df>
[/code:21wbq8ch]

아마도 레드햇 계열 예전 책을 보고 공부중이신 것 같은데, 그 책은 다 무시하고 설정 아무것도 하지 말고 vi를 실행하세요. 특히 LANG="ko_KR.eucKR"이 문제네요. 우분투 기본 설정은 LANG="ko_KR.UTF-8"이 기본으로 한글이 안깨집니다.

[quote="uriel":345uzzzr]아마도 레드햇 계열 예전 책을 보고 공부중이신 것 같은데, 그 책은 다 무시하고 설정 아무것도 하지 말고 vi를 실행하세요. 특히 LANG="ko_KR.eucKR"이 문제네요. 우분투 기본 설정은 LANG="ko_KR.UTF-8"이 기본으로 한글이 안깨집니다.[/quote:345uzzzr]

시도해본건 2번째 것 뿐입니다…
아무런 설정안한 상태에서도 깨졌었습니다…
제가 영문버전 우분투에 한글은 scim으로 입력하고 있어요…
이것이 문제가 되나요.? :?:

터미널이 7bit 이어서 그런게 아닐까요?

> stty cs8 -parenb -ixany -istrip

이렇게 해보시면 어떨지요?

[quote="노미오":1lfc893f]터미널이 7bit 이어서 그런게 아닐까요?

> stty cs8 -parenb -ixany -istrip

이렇게 해보시면 어떨지요?[/quote:1lfc893f]

역시 되지를 않습니다…
혹시 .vimrc 파일내용이 잘못된거일 수도 있을것 같아…
.vimrc 내용을 첨부 하겠습니다.

[quote="redhaze":2nzecb4j][quote="노미오":2nzecb4j]터미널이 7bit 이어서 그런게 아닐까요?

> stty cs8 -parenb -ixany -istrip

이렇게 해보시면 어떨지요?[/quote:2nzecb4j]

역시 되지를 않습니다…
혹시 .vimrc 파일내용이 잘못된거일 수도 있을것 같아…
.vimrc 내용을 첨부 하겠습니다.[/quote:2nzecb4j]

너무 어이없게 해결했습니다. ㅡㅡ;
터미널에 터미널 -> 문자 인코딩 설정 -> 한국어(UHC)로 변경하니 한글이 깨끗이 나오는 군요… 허허…;;