LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-26-2006, 12:11 PM   #1
russiantux
LQ Newbie
 
Registered: Dec 2005
Posts: 2

Rep: Reputation: 0
vi encoding


i write files (c,h,cpp) at vi. i need save them at UTF-8 encoding. how to do it ?
 
Old 01-26-2006, 12:59 PM   #2
TheLinuxDuck
Member
 
Registered: Sep 2002
Location: Tulsa, OK
Distribution: Slack, baby!
Posts: 349

Rep: Reputation: 33
Has your version of vim been compiled with support for this?
You can check by running:
Quote:
vim --version | grep multi_byte
If there is a '-' in front, then your version of vim was not compiled with it, and you'll have to recompile vim with what they call "big" features (you'll have to read the compilation/installation docs for more information).

If there is a '+' in front, then you're one step closer. (=

Also, doublecheck that your systems locale is set correctly. I would imagine that it is, but checking is good. (See if the environment var LANG is set to your locale).

Then, inside of vim, check to see that the 'language' option is set correctly (this will only work if your vim has multi_byte support compiled in). You can see it by loading vim and then issuing the command:
Quote:
:language
If it is not correct, you can set it as your environment locale setting.

Finally, you'll need to make sure that the 'encoding' option is set correctly (again, this will only work if multi_byte support has been compiled into vim). You can show it by loading vim and issueing the command:
Quote:
:set encoding
You can set it to UTF-8 by:
Quote:
:set encoding=utf-8
These options should all be settable in your ".vimrc" file, too.

All of this information and more can be found at:
http://www.vim.org/htmldoc/mbyte.html

вам желаю успех!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Encoding of ,, Anden008 Linux - General 2 11-17-2005 03:53 AM
Other than US encoding kornerr Linux - General 4 01-21-2005 10:42 AM
CD ripping and encoding? e1000 Linux - Software 5 05-22-2004 03:41 AM
encoding on a webpage spank Linux - Newbie 0 12-05-2003 05:49 PM
MP3 Encoding - Please Help biggsjm Linux - Software 9 10-06-2003 03:52 PM


All times are GMT -5. The time now is 02:58 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration