File: unicode.html

package info (click to toggle)
mined 2000.10-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 10,904 kB
  • ctags: 2,258
  • sloc: ansic: 130,722; sh: 1,725; makefile: 260; perl: 169; sed: 152; cpp: 28
file content (275 lines) | stat: -rw-r--r-- 10,527 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
<style>
.reverse {color: white; background-color: black;}
.unispecial {background-color: cyan;}
</style>

<head>
<meta name="description" content="Mined - UTF-8 mode editing.">
<meta name="keywords" content="editor, text mode editor, programmers editor, programming editor, Unicode editor, UTF-8 editor, Unicode text editor, UTF-8 text editor, Unicode text mode editor, UTF-8 text mode editor, text mode Unicode editor, text mode UTF-8 editor, text mode HTML editor, CJK editor">
<meta name="robots" content="index">

<title>mined 2000 Unicode Howto</title>

<script language="JavaScript">
top.select ("unicode");
</script>

</head>

<br>
<center>
<h3>Mined Unicode Howto</h3>
<h4>Environment setup and Usage of mined for Unicode text</h4>
</center>

<br>
<ul>
<h4>UTF-8 encoded Unicode support and features</h4>
<li> <img align=absmiddle src=handr.gif>
    See the <a href=features.html#unicode>mined features</a> page for 
    an overview of mined support for Unicode editing.
<li> For general information on Unicode and its support on computers, 
    see also Markus Kuhn's 
    <a target=_blank href=http://www.cl.cam.ac.uk/~mgk25/unicode.html>
    UTF-8 and Unicode FAQ for Unix/Linux</a>.
</ul>


<br>
<dl>
<dd>
<h4>Environment setup</h4>
<dl>

<p>
<dt><i>Install suitable terminal</i>
<dd>
	Mined is a text mode editor. Its UTF-8 support is available 
	for example with the newer versions of
	<a target=_blank href=http://dickey.his.com/xterm/xterm.html>
	xterm</a> (>= 145 recommended), 
	<a target=_blank href=http://sourceforge.net/projects/rxvt-unicode>
	rxvt-unicode</a>, mlterm, or on the Linux console, each in UTF-8 mode.
<ul>
<li>If you don't have a recent version of xterm on your system, compile 
one yourself; configure xterm with the option "--enable-wide-chars" or 
use the script <code>configure-xterm</code> from the 
mined runtime support library. Then invoke "make".
</ul>

<p>
<dt><i>Install suitable fonts</i>
<dd>
	Install Unicode fonts for your X server.
<ul>
<li>To check if your X installation already provides Unicode fonts, 
you may invoke the command <nobr><code>xlsfonts | grep iso10646</code></nobr>.
If this doesn't list anything, or if you cannot find a suitable font 
setup, do the following:
<dl>
<dd>
<li>Retrieve some of the following fonts:
<ul>
<li>	<a href=http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts.tar.gz>
	UCS fonts for X</a>
	with their 
	<a href=http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts-asian.tar.gz>
	CJK supplement</a>
	from Markus Kuhn's page
	<a target=_blank href=http://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html>
	Unicode fonts and tools for X11</a>
<li>	<a href=http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts-75dpi100dpi.tar.gz>
	Adobe and B&H bitmap fonts</a>
	from the same site which contain fixed width Courier and 
	Lucida Typewriter fonts
<li>	<a href=http://www.inp.nsk.su/~bolkhov/files/fonts/univga/uni-vga.tgz>
	Unicode VGA font</a>
	from 
	<a target=_blank href=http://www.inp.nsk.su/~bolkhov/files/fonts/univga/>
	Dmitry Bolkhovityanov</a>'s site
<li>	<href=http://bibliofile.mc.duke.edu/gww/fonts/Monospace/MonospaceRoman.bdf.tar.gz>
	Monospace Roman BDF fonts</a>
	and their Oblique / Bold / Bold Oblique supplements from 
	<a target=_blank href=http://bibliofile.mc.duke.edu/gww/fonts/Unicode.html>
	George Williams Unicode fonts page</a>
</ul>

<li>The nicest looking font in the UCS fonts archive mentioned above 
is the 10x20 size font, it is suitable for higher screen resolutions.
Unfortunately, the CJK double-width fonts are not distributed in 
the corresponding 20x20 size, but only in the 18x18 size. The 
corresponding single-width font in 9x18 size, however, looks quite 
spindly and for my taste rather awkward.
<br>
For this reason, I am providing a script to generate 20x20 CJK fonts 
automatically from the 18x18 UCS fonts distributed for X servers.
It is <code>bdf18to20</code> and you find it in the mined runtime 
support library. Go into the directory where you unpacked the fonts 
and invoke the script.

<li>Install the fonts with your X server: unpack them into a directory 
(e.g. <code>$HOME/xfonts</code>), go into that directory, invoke the 
<code>mkfontdir</code> command. Then make sure that the fonts are 
loaded into your X server, using the command
<code>xset +fp $HOME/xfonts</code>; a suitable place to include this 
would be your <code>$HOME/.xinitrc</code> X initialisation file if you 
have one.
<dl>
<dd><i>Note:</i> If you are working in a network, make sure the xset 
command is invoked such that the X server has access to the given 
directory on the machine it is running on.
<dd>Some X servers (e.g. 
Exceed on Windows) do not accept BDF fonts; use the "Compile Fonts" 
function of the configuration menu to install the fonts.
</dl>

</dl>
</ul>

<p>
<dt><i>Start terminal in UTF-8 mode</i>
<dd>
	Invoke a terminal window in UTF-8 mode and configure it to use 
	fonts sufficient to display the text you want to edit.
<ul>
<li>Invoke xterm with suitable resource configuration or command line 
parameters.
I recommend to invoke xterm with my Unicode xterm invocation script
<code>uterm</code> from the mined runtime support library.
<br>Since mined 2000.8, UTF-8 mode is auto-detected. So it will work 
even if your locale environment is not configured correctly.
<dl>
<dd><i>Note:</i> xterm is quite touchy about configuring suitable 
matching fonts for single-width and double-width glyphs. If you are 
unlucky, CJK character display will result in garbage on the screen. 
My recommendation is to generate the 20x20 UCS fonts with my 
<code>bdf18to20</code> script as mentioned above and configure xterm 
to use 10x20 - it will then automatically select one of the 20x20 
fonts for double-width characters; if you have a preference among 
them, use the -fw command line option or the wideFont X resource (in 
your <code>$HOME/.Xdefaults</code> file).
See the pattern file <code>Xdefaults.mined</code> in the mined runtime 
support library for suggestions of suitable entries.
(Double-width font matching works much better with rxvt which even seems 
to scale double-width fonts in an acceptable way if needed.)
</dl>

<li>If you prefer rxvt, use rxvt-unicode and make sure to indicate 
using UTF-8 by setting a locale in your environment that is installed 
on your system.
<dl>
<dd><i>Note:</i> rxvt is quite touchy about configuring a known locale 
setting; it does not have a strict UTF-8 option that would reliably 
work on all systems.
<br>
<i>Hint:</i> For hints how to configure the environment explicitly so 
that rxvt and other applications work with UTF-8, see the mined manual 
page (about LC_CTYPE and other environment variables).
Accurate locale setting is not needed by xterm and mined.
</dl>

<li>Alternatively, you can start mined directly together with its own 
terminal window. For this purpose, the mined runtime support library 
contains the script <code>umined</code>.
<dt>On a Windows system, you can also use the script 
<code>wmined</code> or <code>wmined.bat</code> which will invoke mined 
in an rxvt terminal window. <code>wmined</code> starts rxvt with 
Windows look-and-feel colour settings and tries to match your font 
size preferences by inspecting the Windows registry. The advantage of 
using rxvt on Windows is that it can run stand-alone, without an X server.
The disadvantage is that rxvt-unicode does not run on Windows yet.
</ul>

</dl>
</dl>


<br>
<dl>
<dd>
<h4>Handling Unicode text with mined</h4>

<dl>

<p>
<dt><i>Screen handling</i>
<dd>
	Usually, mined will auto-detect a UTF-8 terminal and also 
	the detailed features it has (like double-width and 
	combining characters, Arabic ligature joining, different width 
	data sets).

<p>
<dt><i>Character encoding</i>
<dd>
	By default, mined detects automatically if the text in an edited 
	file is UTF-8 encoded (Unicode character set) or not (either 
	8 bit encoded or CJK encoded); it also detects and maintains UTF-16.
	<br>
	Mined handles illegal UTF-8 sequences transparently so 
	if you accidentally open an 8 bit or CJK encoded file in UTF-8 
	mode, or a file with mixed parts, you can edit the text without 
	problems and will not loose any information. Non-UTF-8 codes 
	are indicated by display background highlighting.
	<br>
	While editing, you can switch the character encoding assumed 
	for text interpretation with the encoding menu 
	(left-click to toggle current and previous encoding, 
	right-click to open menu).

<p>
<dt><i>Unicode display on non-Unicode terminal</i>
<dd>
	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 <code class=unispecial></code> 
	with special indications for wide and combining characters.
	The Euro symbol is displayed as <code class=unispecial>E</code>.
	Please consult the manual page, section 
	<a href=mined.html#utf8display>Unicode display</a> for details.

<p>
<dt><i>Combining characters</i>
<dd>
	Mined supports display and editing of combined characters 
	consisting of a base character and one or more combining 
	characters.
	<br>
	It provides two display mode, a combined display mode 
	which displays the combined characters as they should appear, 
	and a separated display mode which separates base character 
	and combining characters for explicit handling.
	These modes can be selected and are indicated in the 
	Combining display flag: <code></code>: combined mode, 
	<code class=unispecial>`</code>: separated mode.
	<br>
	See the manual page, section <a href=mined.html#combined>
	Combining characters</a> for details.

<p>
<dt><i>Bidirectional display</i>
<dd>
	Mined auto-detects if it is run in a terminal that supports 
	bidi scripts (e.g. mlterm), or it can be told so with the 
	command line parameter <code>+UU</code>.
	The mined runtime support library contains a script 
	<code>mterm</code> to invoke mlterm with suitable parameters 
	to set up bidi mode and a suitable font.

<p>
<dt><i>CJK and 8 bit character set support on Unicode terminal</i>
<dd>
	Mined also handles major CJK encodings in a UTF-8 terminal, 
	as well as a selected set of mapped 8 bit character sets.
	See the <a href=features.html#cjk>mined features</a> page, 
	or the manual page, sections <a href=mined.html#cjk>
	CJK support</a> and <a href=mined.html#charencoding>
	Character encoding support</a> for details.

</dl>
</dl>


<hr>
<dt>Mined <a target=_top href=./>homepage</a> and download.
<dt><a href=mailto:mined@towo.net>Thomas Wolff</a>