I'm using Vim on a machine through SSH with PuTTY.
In my shell (bash), I can copy/paste unicode characters, like ‘ ¿ ’
using Shift + Insert and it works as expected. In Vim, within the same shell session, however, I get this instead.
▒~@~X¿▒~@~Y
Pulling up :digraphs
shows that this is happening with all unicode characters.
I have this in my vimrc:
set encoding=utf-8
set fileencoding=utf-8
And here is the output from the locale
command:
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=en_US.UTF-8
Why can I not use special characters within Vim when they work fine on the command line?
Edit: The remote character set in PuTTY is set to UTF-8.
Edit 2: Output from vim --version
VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Feb 22 2009 06:30:54)
Compiled by steve@v480
Normal version with GTK GUI. Features included (+) or not (-):
-arabic +autocmd +balloon_eval +browse +builtin_terms +byte_offset +cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+cryptv +cscope +cursorshape +dialog_con_gui +diff +digraphs +dnd -ebcdic
-emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path +find_in_path
+float +folding -footer +fork() -gettext -hangul_input -iconv +insert_expand
+jumplist -keymap -langmap +libcall +linebreak +lispindent +listcmds +localmap
+menu +mksession +modify_fname +mouse +mouseshape -mouse_dec -mouse_gpm
-mouse_jsbterm -mouse_netterm -mouse_sysmouse +mouse_xterm -multi_byte
+multi_lang -mzscheme +netbeans_intg -osfiletype +path_extra -perl +postscript
+printer -profile -python +quickfix +reltime -rightleft -ruby +scrollbind
+signs +smartindent -sniff +statusline -sun_workshop +syntax +tag_binary
+tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title
+toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
+vreplace +wildignore +wildmenu +windows +writebackup +X11 -xfontset +xim
+xsmp_interact +xterm_clipboard -xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/usr/local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -I/usr/local/include/gtk-1.2 -I/usr/local/include/glib-1.2 -I/usr/local/lib/glib/include -I/usr/X11R6/include -I/usr/openwin/include -I/usr/local/include -I/usr/local/ssl/include -I/usr/local/pgsql/include -I/usr/local/include/ncurses -I/usr/local/BerkeleyDB.4.2/include -I/usr/openwin/include -I/usr/local/rrdtool-1.2.19/include -O2 -L/usr/local/pgsql/lib -R/usr/local/pgsql/lib -L/usr/local/lib -R/usr/local/lib -L/usr/local/ssl/lib -R/usr/local/ssl/lib -L/usr/openwin/lib -R/usr/openwin/lib -I/usr/local/rrdtool-1.2.19/include -I/usr/X11R6/include -I/usr/openwin/include
Linking: gcc -L/usr/X11R6/lib -R/usr/X11R6/lib -L/usr/openwin/lib -R/usr/openwin/lib -L/usr/local/lib -R/usr/local/lib -R/usr/lib -L/usr/local/pgsql/lib -R/usr/local/pgsql/lib -L/usr/lib -R/usr/openwin/lib -L/usr/openwin/lib -L/usr/local/ssl/lib -R/usr/local/ssl/lib -L/usr/local/BerkeleyDB.4.2/lib -R/usr/local/BerkeleyDB.4.2/lib -L/usr/X11R6/lib -R/usr/X11R6/lib -o vim -L/usr/local/lib -L/usr/X11R6/lib -R/usr/X11R6/lib -L/usr/openwin/lib -R/usr/openwin/lib -lgtk -lgdk -lgmodule -lglib -lintl -lXext -lXt -lX11 -lSM -lICE -lm -lncurses -lnsl -lsocket
set guifont=Lucida_Sans_Typewriter:h10:cANSI
. I was having the same problem until I changed the font.¿
displays in this fontvim -Nu NONE
? What is the output ofvim --version
?vim --version
to the question. Yes, the issue does persist withvim -Nu NONE