Re: [Vim] UTF-8



I'm using Vim6.4 for Windows. I want to be able to read and write
Unicode files (UTF-8). However, if I'm creating a new file, then I
want it to default to standard ascii.

Do you really mean UTF-8, or do you mean UTF-16? The fact that you
mentioned Windows and Notepad makes me wonder, because the two-byte
Unicode files that Windows handles are actually UTF-16.

Either. It's not really the type of unicode that my question is about.
I want it to be able to read/write whatever type of format that the
file happens to already be in, whether this is ascii, utf-8, utf-16,
etc.(basically autodetecting like notepad does). Then when I save that
particular file, for vim to honour the original file format and not
change it. However, if I create a new file in vim, then I want this to
default to ascii.

Is this possible to set up?

Thank again,
Dan.
.



Relevant Pages

  • Re: GAS-style syntax issue...
    ... but, alas, the issue becomes a little more hairy than a few simple parser ... I guess it is an issue right up there with making the assembler UTF-8 ... (UTF-16 just wastes too much memory IMO, ... majority of text is ASCII... ...
    (alt.lang.asm)
  • Re: what does "serialization" mean?
    ... UTF-8 means that each unit is 8 bits ... of characters common to ASCII UTF-8 and UTF-16, ... bytes were used to represent each character you see. ...
    (comp.programming)
  • Re: Writing out text with nulls
    ... The bytes you posted have mixed UTF-8 and UTF-16 (UTF-8 is the default for StreamWriter, and as long as the characters are all in the 0-127 range will be indistinguishable from ASCII), because you're reading UTF-16 data from the original file and emitted that data as if it were UTF-8. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How to convert from UTF-8 or ASCII to UTF-16 and back.
    ... Otherwise take a look at MultiByteToWideChar() and WideCharToMultiByte ... Mark) and you'll find it at the start of most Unicode and UTF-8 files. ... It's a simple example of how to convert from UTF-8 or ASCII to UTF-16 ...
    (microsoft.public.vc.ide_general)
  • Re: UTF-8
    ... > it to default to standard ascii. ... and it now can read/write unicode files. ... > that every file I create in Vim is now in utf-8 format. ... You could try creating a batch file which will call Vim with different ...
    (comp.editors)