I want to use external tr
command on a line in Vim
. When the source or replace pattern includes Farsi numbers the result is unpredictable.
Executing
:.!tr 1 ۱
on1
results:Û
Executing
:.!tr ۱ 1
on۱
results:11
Executing
:.!tr 12345 ۱۲۳۴۵
on12345
results:Û±Û²Û
The tr
command works correctly in the shell with those parameters. How can I fix this (if it is not a bug)?
This is the output of vim --version
on my OS X 10.11.4:
$ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Apr 22 2016 04:36:23)
MacOS X (unix) version
Included patches: 1-1755
Compiled by Homebrew
Huge version without GUI. Features included (+) or not (-):
+acl +farsi +mouse_netterm +tag_binary
+arabic +file_in_path +mouse_sgr +tag_old_static
+autocmd +find_in_path -mouse_sysmouse -tag_any_white
-balloon_eval +float +mouse_urxvt -tcl
-browse +folding +mouse_xterm +terminfo
++builtin_terms -footer +multi_byte +termresponse
+byte_offset +fork() +multi_lang +textobjects
+channel -gettext -mzscheme +timers
+cindent -hangul_input +netbeans_intg +title
-clientserver +iconv +packages -toolbar
+clipboard +insert_expand +path_extra +user_commands
+cmdline_compl +job +perl +vertsplit
+cmdline_hist +jumplist +persistent_undo +virtualedit
+cmdline_info +keymap +postscript +visual
+comments +langmap +printer +visualextra
+conceal +libcall +profile +viminfo
+cryptv +linebreak +python +vreplace
+cscope +lispindent -python3 +wildignore
+cursorbind +listcmds +quickfix +wildmenu
+cursorshape +localmap +reltime +windows
+dialog_con -lua +rightleft +writebackup
+diff +menu +ruby -X11
+digraphs +mksession +scrollbind -xfontset
-dnd +modify_fname +signs -xim
-ebcdic +mouse +smartindent -xsmp
+emacs_tags -mouseshape +startuptime -xterm_clipboard
+eval +mouse_dec +statusline -xterm_save
+ex_extra -mouse_gpm -sun_workshop -xpm
+extra_search -mouse_jsbterm +syntax
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/usr/local/share/vim"
Compilation: /usr/bin/clang -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X_UNIX -Os -w -pipe -march=native -mmacosx-version-min=10.11 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: /usr/bin/clang -L. -L/usr/local/lib -L/usr/local/lib -Wl,-headerpad_max_install_names -o vim -lm -lncurses -liconv -framework Cocoa -fstack-protector -L/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE -lperl -framework Python -lruby.2.0.0 -lobjc
echo 1 | tr 1 ۱
? – nobe4 Apr 29 '16 at 6:30set encoding=utf-8
setting in my~/.vimrc
. – Hamid Rohani Apr 29 '16 at 12:14۱
. – Hamid Rohani Apr 29 '16 at 12:15Setting the Farsi fonts
. Does it help ? – nobe4 Apr 29 '16 at 12:21