no escaped-prefixes like \u0965, and no \x09\圆5). Here is a method to process a raw hex dump as input (ie. Edit: but as per the comment below, "obsoletes' may just mean "alternative" echo -n 0x0965 |recode UTF-16BE/x4.UTF-8 Īccording to this link: recode (Obsoletes iconv, dos2unix, unix2dos). thanks to Gilles for a suggeston in this askubuntu Q/A. (by "bash" I mean: not using any another scripting language). UPDATE: Here is a bash way to do a single Unicode value. This works in both Python 2 and 3: python -c 'print(u"\u0965")' UPDATE: Also, nowadays a Python example would probably be preferred to Perl. UPDATE: As of Bash 4.2, it seems to be a built in feature now: echo $'\u0965' If you are in a GTK app which includes GVim and GNOME Terminal, you can try Control-Shift-u followed by 4 hex characters to create a Unicode character. For example, I have a keymap I developed called I'm sure Emacs has something similar. It converts a series of characters to another symbol. Vim also supports custom easy to make keymaps. If you want a character beyond U FFFF, use a capital U and type 8 hex characters. While in insert mode, hit Ctrl-V followed by u, then type four hex characters. Most of the time when I need to do this, I'm in an editor like Vim/GVim which has built-in support. Most any UNIX system I am aware of while have Perl available and it even have several Windows ports. Perhaps more portable than relying on a specific shell or echo command is Perl. You can use bash's echo or /bin/echo from GNU coreutils in combination with iconv: echo -ne '\x09\圆5' | iconv -f utf-16beīy default iconv converts to your locales encoding.
0 Comments
Leave a Reply. |