Mined Unicode Howto
Environment setup and Usage of mined for Unicode text
- Screenshot
with opened pop-up menu and with Unicode contents.
UTF-8 encoded Unicode support and features:
- ... are described on the mined features page.
-
Environment setup:
-
Mined is a text mode editor. Its UTF-8 support is available for example
with the newer versions of
xterm
(>= 145 recommended).
Configure xterm with the option "--enable-wide-chars" or use
this xterm configuration script.
Then invoke "make".
-
Install Unicode fonts for your X server.
- Invoke xterm in UTF-8 mode by resource configuration or command parameter.
Also configure the environment of the shell running in the xterm to
indicate UTF-8 encoding to applications using the appropriate LC_...
variables.
- I recommend to invoke xterm with my Unicode xterm invocation script
uterm.
-
How to use UTF-8 modes with mined:
- Screen handling
-
If you have arranged (as suggested above) an appropriate
environment setting that indicates a UTF-8 terminal,
mined will set up its display mode accordingly.
- Character encoding
-
By default, mined detects automatically if the text in an edited
file is UTF-8 encoded (Unicode character set) or 8-bit encoded
(Latin-1 character set).
It also detects UTF-16 (16-bit Unicode representation with surrogate
pairs for a 21-bit character set) and transforms it automatically
into UTF-8.
UTF-8 is the internal representation of mined's Unicode editing.
It also handles illegal UTF-8 sequences transparently so
if you accidentally open a Latin-1 file in UTF-8 mode, or a file
with mixed parts, you may still edit the contents and will not
loose any information. You can switch the interpretation while
editing by clicking on the L/U
letter in the flags area (right part of top line) or toggle
"UTF-8 text" in the eXtra menu.
- Manual mode specification is also available
-
In order to enable detection and handling of Unicode line ends
(line separator and paragraph separator), invoke mined with
mined -uu [«filenames ...»]
.
Please consult the manual page for further options.
- Unicode display on non-Unicode terminal
-
If a UTF-8 file is edited in a Latin-1 terminal environment,
characters outside of the Latin-1 range (greater than 0xFF)
are displayed as a block symbol ¤
with special indications for wide and combining characters.
Handling combined characters:
You may enter combining characters in the text or on the prompt
line (for search expressions or file names). If you don't have any
assigned to your keyboard (this could be configured with xmodmap),
you may use coded or mnemonic input support.
For editing combined characters there are two modes;
switch modes by clicking on the c/C
indicator next to the UTF-8 L/U indicator
in the flags area (right part of the top screen line), or toggle
"combined display" in the eXtra menu.
- Combined editing mode (flag C)
- Combined characters are displayed as intended (i.e., combined).
The cursor can be moved into a combined character with
ctrl-left-arrow or ctrl-right-arrow, provided these cursor keys are
configured to emit distinguished escape sequences with control-key
held. ^V-left-arrow and ^V-right-arrow also work. You can determine
the exact position of the cursor if permanent character info is
switched on (by HOP ESC u or with HOP "toggle char info" in the eXtra menu).
- Partially editing combined characters:
- If the cursor is on a combined character, delete next character
will delete the whole combined character, with all combining accents.
- If the cursor is within a combined character, delete next
character will delete the current combining accent only.
- You can also position the cursor as described above and use
copy-and-paste operations.
- Separated editing mode (flag c)
- Combined characters are separated into base character and
combining character(s) for display and editing.
Edit the separated characters as usual.
- In separated display mode, all cursor and text modification
operations work on the combining parts as displayed.
-
Bidirectional display:
- Run mined in a bidirectional terminal (e.g. mlterm).
- Invoke mined with the parameter -o to suppress scrollbar display
(would confuse with the terminal's bidi algorithm).
You may configure your environment for this option:
MINED=o; export MINED
Mined homepage and download.
Thomas Wolff