Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [encoding]

File encoding(s) such as ASCII, ISO-8859, UTF-8, etc.

Filter by
Sorted by
Tagged with
0 votes
1 answer
32 views

Backspaces in script are not interpreted in playback

I recently learned of the -w option to record inputs. Trying to "play them back" with -s, it seems the playback doesn't perfectly reproduce the edits in at least one way backspaces, <80&...
Adam's user avatar
  • 103
3 votes
1 answer
67 views

Can ++enc=utf-8 be made the default action for :w?

After pasting text snippets from web sites into an existing Vim file, I often have to save the file with :w ++enc=utf-8 to avoid a conversion error. Can that be made the default? I have set ...
carolus's user avatar
  • 33
1 vote
1 answer
157 views

Vim command-line mode encoding error when using global search in autocmd

Update Found the issue due to souce the menu this cause encoding=utf-8 and fileencoding=cp936 in _vimrc but in txt files it shows encoding=utf-8 fileencoding=utf-8 The way to fix is reset fenc=utf-8 ...
M_Sea's user avatar
  • 157
0 votes
2 answers
446 views

How to change the encoding of the text in the current buffer?

I have written a file with :set fileencoding=ISO-2022-JP :wq. When I try to open it again it is completely unreadable. :set encoding? shows that vim has misinterpreted the content as encoding=utf-8. ...
jakun's user avatar
  • 155
2 votes
0 answers
47 views

Vim and locales

I'm running Vim (9) on Ubuntu both on my local machine and a VPS. I was working on moving my config to the server, where I encountered an error saying: Invalid argument: listchars=tab:~@\ ,trail:~@,...
fbence's user avatar
  • 677
1 vote
1 answer
131 views

How Do I Turn a String into URL Encoded String?

I'm trying to turn a JSON format string into parsable URL encoded string. Here's my process: " Read the contents of the file separated into lines let lines = join(getline(1, '$'), '\n') " ...
Samuel Bacay's user avatar
1 vote
1 answer
364 views

Vim's "ga" and utf-8 characters: What is <M-x>?

I pasted text A ∩ B into Vim in order to figure out how the "cap" character is represented. Using its code, I would then figure out the right commands to print it out from a data analysis ...
user2153235's user avatar
0 votes
0 answers
53 views

'set fileencoding' for new files. Vim says it won't work, but is it really so?

set encoding=utf-8 set fileencoding=cp1251 set fileencodings=ut8-8,latin1 set laststatus=2 set statusline=%{(&fileencoding)} Vim help says that only global value of fileencoding won't for new ...
user90726's user avatar
  • 123
1 vote
0 answers
23 views

Vim still displays the last removed character

when my terminal LANG=en_US.UTF-8, my vim display is messed in that when page down or page up, the last page's conent is still displayed. or when I delete a character, for example, in "abcdef&...
user41771's user avatar
0 votes
1 answer
616 views

File encoding other than utf-8

There is a file that I have to use in iso-2022-jp encoding. I tried :e ++enc=iso-2022-jp :w in the hope of converting the fileencodings to "iso-2022-jp" permanantly. But the next time I ...
Taro's user avatar
  • 153
1 vote
1 answer
168 views

How to show Chinese characters in Floating Terminal inside Neovim?

As title. Also I'm using Neovim inside Tmux. I've tried both with/without Tmux and the results are the same:
NeoZoom.lua's user avatar
  • 1,500
2 votes
1 answer
111 views

Making Vim work with Unicode: what is the reason to use "setglobal fileencoding=utf-8"?

There is a tip on Vim Wiki about working with Unicode: if has("multi_byte") if &encoding !~? '^u' if &termencoding == "" let &termencoding = &encoding ...
user90726's user avatar
  • 123
2 votes
1 answer
3k views

How can I detect the encoding of a file correctly?

Sometimes I download files in cp1251, cp866, and koi8r encodings, all of which are used to represent Cyrillic characters. How should I specify them in set fileencodings=... so that when I open such a ...
user90726's user avatar
  • 123
1 vote
1 answer
226 views

How to show the currents char code in ruler

I want the ruler made to show the current characters code. This code differs from encoding to encoding. This is because I have to handle different file comming from users. Some from Unix/Linux, most ...
Andy A.'s user avatar
  • 233
1 vote
2 answers
1k views

How to temporarily change file encoding?

I'm using a plugin which can show the minimap for the file I'm editing. The plugin can only works with utf-8. Does anyone know how to dynamically/temporarily change the encoding in Vim, so I can make ...
NeoZoom.lua's user avatar
  • 1,500
0 votes
0 answers
25 views

Windows save type breaks vim

So I wanted to use this plugin but if I start it, I'm getting this error message: (I changed that line a bit to hash('nvim') but the ^M still breaks the code because it has a the microsoft line-...
TornaxO7's user avatar
  • 571
1 vote
1 answer
576 views

How to copy and paste non English characters?

I'm using: Neovim v0.4.4 Mac v10.13.6 iTerm2 When I copy non English text, for example 中文(简体) and paste it to neovim, it become ???? The same thing happens to when I copy it from neovim and paste ...
Lai32290's user avatar
  • 275
0 votes
1 answer
272 views

Chinese characters become unrecognizable overnight in Neovim

I typed a lot of Chinese characters in Neovim into a LaTeX file (.tex), and when I opened the file the next day all the characters became unrecognizable (everything looked great before I shut down my ...
Ahacad's user avatar
  • 131
2 votes
1 answer
215 views

How to get the encoded byte sequence for a character in the status line?

I want to display the hex byte sequence for the character under the cursor as it is actually stored on disk. Currently my status line contains 0x%04.5B which works fine for ASCII/latin1 files but for ...
Michael Härtl's user avatar
2 votes
0 answers
71 views

Unreadable characters in command section and Quickfix window [duplicate]

Good day! Do yo have any idea how to fix this issue? Please refer to the screenshot. I don't have the slightest clue why these characters are appearing. My vim-fugitive plugin was working fine before....
Oneb's user avatar
  • 21
3 votes
0 answers
70 views

Wrong width for certain characters

Using this: https://github.com/vim/vim-win32-installer/releases/download/v8.2.1505/gvim_8.2.1505_x64.zip All of these characters (and perhaps others): ℹ ⌨ ⏏ ⏭ ⏮ ⏯ ⏱ ⏲ ⏸ ⏹ ⏺ ☀ ☁ ☂ ☃ ☄ ☎ ☑ ☝ ☠ ☠️ ☢ ☣ ☦ ☪...
Zombo's user avatar
  • 1
1 vote
1 answer
836 views

Can't copy special characters outside of vim

I'm using NVIM v0.4.3 with set clipboard=unnamed. I can insert special character like üäö in vim just fine, but if I copy content containing special characters in vim and try to paste them outside of ...
user7802048's user avatar
0 votes
1 answer
76 views

modelines not executed when opening new file in new tab

I'm often switching between files with a unix encoding and those with a dos encoding. I find that when I start with a unix encoded file, and then open a dos encoded file, vim attempts to use the ...
Matt's user avatar
  • 125
3 votes
0 answers
619 views

Can't use special characters in listchars even if setting scriptencoding to utf-8

Here is my .vimrc file: set encoding=utf-8 scriptencoding utf-8 set list set listchars=tab:→· When I open vim, it will show an error message E474: Invalid argument: listchars=tab:→· My vim is Vi ...
haolee's user avatar
  • 285
1 vote
0 answers
354 views

Terminus font broken in gVim on Fedora 31

I have just upgraded to Fedora 31 and see that my gVim with Terminus 12 font looks like this: Resetting the guifont option gives me a reasonable looking gVim back. How can I further diagnose this ...
Martin Ueding's user avatar
0 votes
0 answers
115 views

My vim can't print Chinese right on my mac?

only the vim app can't show the Chinese right. I have checked the encoding, fileencoding and fileencodings configs, all of them are utf-8 at the first.
rolin.tencent.Shenzhen's user avatar
0 votes
1 answer
93 views

Why does backslash-escaping a CJK character cause a very-magic regex match to fail?

My understanding of very-magic regexes is that you can escape any character outside [A-Za-z0-9_] with a backslash to make it match literally. However, I don't see that behaviour with CJK characters. ...
cxw's user avatar
  • 974
2 votes
1 answer
2k views

How can I search for Unicode characters by hex code in very magic regexes in vimscript?

I am working on UTF-8 support for my editorconfig-core vimscript plugin. I have hit a strange snag. This is in official GVim 7.4 Win32. I would like to get this working on 7.4, rather than ...
cxw's user avatar
  • 974
10 votes
2 answers
2k views

What is fileencoding of .vimrc?

I've upgraded vim and now it's unhappy about some UTF-8 values in my .vimrc. This lead me to the question -- when vim reads .vimrc, what encoding does it assume the file has? I.e. what's fileencoding ...
user avatar
1 vote
1 answer
417 views

Vim not encoding with UTF-8

I'm using Vim, installed from the Arch Linux repo. I've tried adding set fileencodings=utf-8 and set encoding=utf-8. I've tried with all caps (UTF instead of utf) and putting it in /etc/vimrc and ~/....
Nero gris's user avatar
  • 161
3 votes
1 answer
8k views

Specify UTF-8 encoding in Vimrc

Since Vim and NeoVIM defaults to UTF-8, does it make any sense to specify the same option explicitly in vimrc? set encoding="utf-8"
Zoltan King's user avatar
1 vote
2 answers
512 views

Can I fall back to latin1 if there are illegal bytes?

The help text for fileencodings says this: This is a list of character encodings considered when starting to edit an existing file. When a file is read, Vim tries to use the first ...
Daniel Wagner's user avatar
1 vote
0 answers
202 views

What encoding does :! use?

I'd like low-level control over exactly what bytes I send and receive from a process spawned from some vimscript. What encoding is used for communications with commands started with :!foo? Can I ...
Daniel Wagner's user avatar
-1 votes
1 answer
106 views

Is \r operating system specific?

In the Vim documentation, it says that \r "matches < CR >", however for the result of replacement I could not find in the documentation a description of what it does. For example, imagine this: :%...
Tyler Durden's user avatar
  • 2,131
1 vote
0 answers
67 views

Reading in content from an external command with utf-8

I've got the following vim script to show a perldoc or per man page into a new tab and then rewrap it the text so it's more readable (I have a very wide monitor). nnoremap K :execute "tabnew <bar&...
StevieD's user avatar
  • 1,492
8 votes
2 answers
9k views

UTF-8 not working on VIM

I've searched a lot about this on Internet but nothing's working. I'm using Vim 8.0.3 on Windows 10 and I can't get the right encoding to work. It's not a problem when writing code, but the problem ...
Andrés Orozco's user avatar
0 votes
1 answer
933 views

Why is it that if I put "set encoding=utf-8" in my vimrc file, plugins won't load properly?

Here is my vimrc file: call plug#begin('$HOME/vimfiles/plugged') Plug 'vim-airline/vim-airline' Plug 'itchyny/lightline.vim' Plug 'kien/ctrlp.vim' Plug 'python-mode/python-mode' Plug 'rdnetto/YCM-...
user14122's user avatar
2 votes
1 answer
492 views

How to interpret ASCII codes returned by "ga" command?

I'm cleaning data imported from Excel to Access, and ran across funny quotes that I'm having trouble getting unambiguous ASCII codes for. They are the hooked single quotes ‘ and ’. Vim's ga command ...
user36800's user avatar
  • 443
1 vote
2 answers
819 views

How to combine reading from stdin (- invocation argument) with ++opt

I'm trying to combine two features of vim, but it doesn't seem to be possible. 1: vim - The first feature is invoking vim with a single-dash argument, which causes vim to read stdin and use the ...
bgoldst's user avatar
  • 163
3 votes
3 answers
2k views

Printing unicode chars?

Is there a solution to printing unicode characters from gvim? See this: Results in this print result (Using a Linux setup and Vim 8.0.)
LaTechneuse's user avatar
4 votes
1 answer
836 views

How do I write a multi-line message to the quickfix or location list?

I've got a program that spits out multi-line messages separated with something other than a newline. I want these messages to show in the quickfix and location lists spanning multiple lines as ...
John Freeman's user avatar
5 votes
1 answer
369 views

Vim and gVim in Windows doesn't recognize Mongolian letters Өө and Үү

I'm trying to open and edit files with Mongolian text, written in Mongolian Cyrillic. In the cmd terminal and in powershell terminal if I choose Consolas font, everything is ok with Mongolian Cyrillic,...
kusrabs's user avatar
  • 71
1 vote
1 answer
333 views

Encoding of the spellfile en.utf-8.add

When I open my private spellfile en.utf-8.add, words containing unusual characters, such as pœësis, are rendered incorrectly; in this case, pÅësis. At the bottom of the screen it says [converted], ...
Toothrot's user avatar
  • 3,139
2 votes
1 answer
818 views

Can I change the encoding of the content of a file to show Chinese characters?

I have a file containing contents(Unicode escape string in specific) like this: title=\"\u5e2e\u4e0a\u5934\u6761\">\u5e2e\u4e0a\u5934\u6761<\/a><\/li>\n in my working Vim window ...
Lerner Zhang's user avatar
3 votes
0 answers
209 views

system function output with Chinese chars

I want to run shell command with system function and the command output has some Chinese chars. echo system('svn status') But I got incorrect encoding output like this: svn: ?\232?\173?\166?\229?\...
Fenghua Shu's user avatar
9 votes
1 answer
346 views

Can I define a custom encoding for vim?

I frequently use Programming Puzzles and Code-golf. Lots of users over there have written custom languages purely for golfing. I'm even working on my own right now. Lots of these languages have their ...
DJMcMayhem's user avatar
  • 17.6k
0 votes
1 answer
1k views

Getting Error while opening files through vim

I am trying to use unicode characters in vim. Since msdos prompt didnt support unicode, I downloaded cygwin. I added some commands in .vimrc through cygwin. Basic commands like setting encoding, ...
SibiCoder's user avatar
  • 3,402
9 votes
1 answer
844 views

Wrong encoding while calling shell

I was experimenting with a DOT diagram and tried to do the following: :! dot -Tpng -oFab.png % I got an error because my filename has a special character ("ó" in "Fabricación"): C:\windows\system32\...
Roflo's user avatar
  • 767
5 votes
1 answer
2k views

gvim incorrect font (or encoding) in menu

I use 32bit gvim 7.4 on Win7 64bit CZ. I replaced the gettext and iconv libraries according to the guide on the vim website. I wanted to use utf-8 and have setup the guifont, encoding and fileencoding ...
sharpener's user avatar
  • 151
3 votes
1 answer
1k views

How does vim map keystrokes to hex values?

This question might be a little bit out of the ordinary for this site, but I want to better understand how vim works under the hood. I know that if I enter the hex value 0x01 vim will display it as ^A....
DJMcMayhem's user avatar
  • 17.6k