-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathencoding.html
More file actions
485 lines (434 loc) · 28.9 KB
/
encoding.html
File metadata and controls
485 lines (434 loc) · 28.9 KB
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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
<!DOCTYPE html>
<html lang="en" data-content_root="../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Display of International Characters in MapServer — MapServer 8.6.1 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=03e43079" />
<link rel="stylesheet" type="text/css" href="../_static/sphinx.css?v=48f05237" />
<link rel="stylesheet" type="text/css" href="../_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="../_static/custom.css?v=dd298242" />
<link rel="stylesheet" type="text/css" href="../_static/ribbon.css?v=ea091bf4" />
<script src="../_static/jquery.js?v=5d32c60e"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="../_static/documentation_options.js?v=ad95d4c4"></script>
<script src="../_static/doctools.js?v=fd6eb6e6"></script>
<script src="../_static/sphinx_highlight.js?v=6ffebe34"></script>
<script src="../_static/clipboard.min.js?v=a7894cd8"></script>
<script src="../_static/copybutton.js?v=f281be69"></script>
<link rel="icon" href="../_static/mapserver.ico"/>
<link rel="author" title="About these documents" href="../about.html" />
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="copyright" title="Copyright" href="../copyright.html" />
<link rel="next" title="Expressions" href="expressions.html" />
<link rel="prev" title="CONFIG" href="config.html" />
</head><body>
<!-- for main branch only, do not backport this -->
<table width="100%" style="width: 100%; background-color: white;">
<tr>
<td rowspan="2" style="padding: 10px 0px 10px 10px;">
<a href="../index.html" title="Home"><img src="../_static/banner.png" alt="MapServer banner" border="0" /></a>
</td>
<td style="padding: 10px 10px 0px 0px; text-align: right; vertical-align: top;">
<a href="../index.html" title="Home">Home</a> |
<a href="../products.html" title="Products (MapServer core, MapCache, TinyOWS">Products</a> |
<a href="https://github.com/mapserver/mapserver/issues/" title="Issue Tracker (MapServer core)">Issue Tracker</a> |
<a href="../community/service_providers.html" title="Professional Service Providers">Service Providers</a> |
<a href="../faq.html" title="Frequently Asked Questions">FAQ</a> |
<a href="https://fosstodon.org/@mapserver" title="Mastodon" target="_blank">Mastodon</a> |
<a href="../download.html" title="Download Source or Binaries">Download </a> |
<a class="badge" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=KRJ2X44N3HA6U&source=url" target="_blank">
<img src="https://img.shields.io/badge/donate-%E2%9D%A4%C2%A0-ff69b4.svg?style=flat" alt="Donate to MapServer">
</a>
</td>
</tr>
<tr>
<td style="padding: 0px 10px 0px 0px; text-align: right; vertical-align: bottom;">
<img src="../_static/flagicons/en.png" alt="en" title="en" border="0" width="18px" height="13px"/>
<a href="../ar/mapfile/encoding.html"><img src="../_static/flagicons/ar.png" alt="ar" title="ar" border="0" /></a>
<a href="../de/mapfile/encoding.html"><img src="../_static/flagicons/de.png" alt="de" title="de" border="0" /></a>
<a href="../el/mapfile/encoding.html"><img src="../_static/flagicons/el.png" alt="el" title="el" border="0" /></a>
<a href="../es/mapfile/encoding.html"><img src="../_static/flagicons/es.png" alt="es" title="es" border="0" /></a>
<a href="../fr/mapfile/encoding.html"><img src="../_static/flagicons/fr.png" alt="fr" title="fr" border="0" /></a>
<a href="../id/mapfile/encoding.html"><img src="../_static/flagicons/id.png" alt="id" title="id" border="0" /></a>
<a href="../it/mapfile/encoding.html"><img src="../_static/flagicons/it.png" alt="it" title="it" border="0" /></a>
<a href="../ja/mapfile/encoding.html"><img src="../_static/flagicons/ja.png" alt="ja" title="ja" border="0" /></a>
<a href="../nl_NL/mapfile/encoding.html"><img src="../_static/flagicons/nl_NL.png" alt="nl_NL" title="nl_NL" border="0" /></a>
<a href="../pl/mapfile/encoding.html"><img src="../_static/flagicons/pl.png" alt="pl" title="pl" border="0" /></a>
<a href="../ru/mapfile/encoding.html"><img src="../_static/flagicons/ru.png" alt="ru" title="ru" border="0" /></a>
<a href="../sq/mapfile/encoding.html"><img src="../_static/flagicons/sq.png" alt="sq" title="sq" border="0" /></a>
<a href="../tr/mapfile/encoding.html"><img src="../_static/flagicons/tr.png" alt="tr" title="tr" border="0" /></a>
</td>
</tr>
</table>
<div class="related" role="navigation" aria-label="Related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="expressions.html" title="Expressions"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="config.html" title="CONFIG"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Home</a> »</li>
<li class="nav-item nav-item-1"><a href="../documentation.html" >MapServer 8.6.1 Documentation</a> »</li>
<li class="nav-item nav-item-2"><a href="index.html" accesskey="U">Mapfile</a> »</li>
<li class="nav-item nav-item-this"><a href="">Display of International Characters in MapServer</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="display-of-international-characters-in-mapserver">
<span id="encoding"></span><span id="index-0"></span><h1><a class="toc-backref" href="#table-of-contents" role="doc-backlink">Display of International Characters in MapServer</a><a class="headerlink" href="#display-of-international-characters-in-mapserver" title="Link to this heading">¶</a></h1>
<dl class="field-list simple">
<dt class="field-odd">Author<span class="colon">:</span></dt>
<dd class="field-odd"><p>Jeff McKenna</p>
</dd>
<dt class="field-even">Contact<span class="colon">:</span></dt>
<dd class="field-even"><p>jmckenna at gatewaygeomatics.com</p>
</dd>
<dt class="field-odd">Last Updated<span class="colon">:</span></dt>
<dd class="field-odd"><p>2026-03-29</p>
</dd>
</dl>
<nav class="contents" id="table-of-contents">
<p class="topic-title">Table of Contents</p>
<ul class="simple">
<li><p><a class="reference internal" href="#display-of-international-characters-in-mapserver" id="id2">Display of International Characters in MapServer</a></p>
<ul>
<li><p><a class="reference internal" href="#credit" id="id3">Credit</a></p></li>
<li><p><a class="reference internal" href="#related-links" id="id4">Related Links</a></p></li>
<li><p><a class="reference internal" href="#requirements" id="id5">Requirements</a></p></li>
<li><p><a class="reference internal" href="#how-to-enable-in-your-mapfile-mapserver-7-0" id="id6">How to Enable in Your Mapfile (MapServer >= 7.0)</a></p>
<ul>
<li><p><a class="reference internal" href="#step-1-verify-iconv-support-and-mapserver-version" id="id7">Step 1: Verify ICONV Support and MapServer Version</a></p></li>
<li><p><a class="reference internal" href="#step-2-verify-that-your-files-encoding-is-supported-by-iconv" id="id8">Step 2: Verify That Your Files’ Encoding is Supported by ICONV</a></p></li>
<li><p><a class="reference internal" href="#step-3-add-encoding-parameter-to-your-layer-object" id="id9">Step 3: Add ENCODING Parameter to your LAYER Object</a></p></li>
<li><p><a class="reference internal" href="#step-4-test-with-the-map2img-utility" id="id10">Step 4: Test with the map2img utility</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#id1" id="id11">How to Enable in Your Mapfile (MapServer < 7.0)</a></p>
<ul>
<li><p><a class="reference internal" href="#add-encoding-parameter-to-your-label-object" id="id12">Add ENCODING Parameter to your LABEL Object</a></p></li>
</ul>
</li>
<li><p><a class="reference internal" href="#example-using-php-mapscript" id="id13">Example Using PHP MapScript</a></p></li>
<li><p><a class="reference internal" href="#notes" id="id14">Notes</a></p></li>
</ul>
</li>
</ul>
</nav>
<section id="credit">
<h2><a class="toc-backref" href="#table-of-contents" role="doc-backlink">Credit</a><a class="headerlink" href="#credit" title="Link to this heading">¶</a></h2>
<p>Initial functionality was added to MapServer 4.4.0 as a part of
a project sponsored by the Information-technology Promotion Agency
(IPA), in Japan. Project members included: Venkatesh Raghavan,
Masumoto Shinji, Nonogaki Susumu, Nemoto Tatsuya, Hirai Naoki (Osaka
City University, Japan), Mario Basa, Hagiwara Akira, Niwa Makoto, Mori
Toru (Orkney Inc., Japan), and Hattori Norihiro (E-Solution Service,
Inc., Japan).</p>
</section>
<section id="related-links">
<h2><a class="toc-backref" href="#table-of-contents" role="doc-backlink">Related Links</a><a class="headerlink" href="#related-links" title="Link to this heading">¶</a></h2>
<ul class="simple">
<li><p>MapServer <a class="reference external" href="https://github.com/MapServer/MapServer/issues/858/">ticket:858</a> (original implementation)</p></li>
<li><p><a class="reference internal" href="../development/rfc/ms-rfc-103.html#rfc103"><span class="std std-ref">RFC 103: Layer Level Character Encoding changes in MapServer 7</span></a></p></li>
<li><p>MapServer <a class="reference external" href="https://github.com/MapServer/MapServer/issues/4758/">ticket:4758</a> (MapServer 7 updates)</p></li>
</ul>
</section>
<section id="requirements">
<h2><a class="toc-backref" href="#table-of-contents" role="doc-backlink">Requirements</a><a class="headerlink" href="#requirements" title="Link to this heading">¶</a></h2>
<ul class="simple">
<li><p>MapServer >= 4.4.0 (MapServer >= 7.0 for layer-level encoding)</p></li>
<li><p>MapServer compiled with the <a class="reference external" href="https://www.gnu.org/software/libiconv/">libiconv</a> library</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>In terms of map labels with international characters, since the MapServer 7.0 release,
other important dependent libraries besides libiconv are <a class="reference external" href="https://www.freetype.org/">Freetype</a>
(to get information about glyph sizes), <a class="reference external" href="https://github.com/fribidi/fribidi">Fribidi</a>
(to handle bidirectional text), and <a class="reference external" href="https://github.com/harfbuzz/harfbuzz">Harfbuzz</a>
(for text shaping).</p>
</div>
</section>
<section id="how-to-enable-in-your-mapfile-mapserver-7-0">
<h2><a class="toc-backref" href="#table-of-contents" role="doc-backlink">How to Enable in Your Mapfile (MapServer >= 7.0)</a><a class="headerlink" href="#how-to-enable-in-your-mapfile-mapserver-7-0" title="Link to this heading">¶</a></h2>
<p>The MapServer 7.0 release contained changes in how MapServer handles
encoding; new in 7.0 is that encoding is set at the <a class="reference internal" href="layer.html#layer"><span class="std std-ref">LAYER</span></a> level.
This makes it much easier to manage having multiple layers in different
encodings, in the same mapfile. The reason for this change was that the encoding
of a dataset affects the whole layer, not only the labels. MapServer 7 will also convert any
strings into UTF8 in the background, and any output (such as through OGC GetCapabilities,
GetFeature, or queries) will be returned in UTF8.</p>
<p>The mapfile <a class="reference internal" href="layer.html#layer"><span class="std std-ref">LAYER</span></a> object’s <em>ENCODING</em> parameter
accepts the encoding name as its parameter.</p>
<p id="index-1">MapServer uses GNU’s <a class="reference external" href="https://www.gnu.org/software/libiconv/">libiconv</a>
library to deal with encodings.
The libiconv web site has a list of supported encodings. One can also
use the “iconv -l” command on a system with libiconv installed to get
the complete list of supported encodings on that specific system.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The label object’s <em>ENCODING</em> parameter is deprecated, but some logic
still exists to handle that use in that scenario, in MapServer 7.</p>
</div>
<section id="step-1-verify-iconv-support-and-mapserver-version">
<h3><a class="toc-backref" href="#table-of-contents" role="doc-backlink">Step 1: Verify ICONV Support and MapServer Version</a><a class="headerlink" href="#step-1-verify-iconv-support-and-mapserver-version" title="Link to this heading">¶</a></h3>
<p>Execute <cite>mapserv -v</cite> at the commandline, and verify that your
MapServer version >= 7.0 and it includes <cite>SUPPORTS=ICONV</cite>, such
as:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">></span> <span class="n">mapserv</span> <span class="o">-</span><span class="n">v</span>
<span class="n">MapServer</span> <span class="n">version</span> <span class="mf">7.7.0</span><span class="o">-</span><span class="n">dev</span> <span class="p">(</span><span class="n">MS4W</span> <span class="mf">4.0.4</span><span class="p">)</span> <span class="n">OUTPUT</span><span class="o">=</span><span class="n">PNG</span> <span class="n">OUTPUT</span><span class="o">=</span><span class="n">JPEG</span>
<span class="n">OUTPUT</span><span class="o">=</span><span class="n">KML</span> <span class="n">SUPPORTS</span><span class="o">=</span><span class="n">PROJ</span> <span class="n">SUPPORTS</span><span class="o">=</span><span class="n">AGG</span> <span class="n">SUPPORTS</span><span class="o">=</span><span class="n">FREETYPE</span>
<span class="n">SUPPORTS</span><span class="o">=</span><span class="n">CAIRO</span> <span class="n">SUPPORTS</span><span class="o">=</span><span class="n">SVG_SYMBOLS</span> <span class="n">SUPPORTS</span><span class="o">=</span><span class="n">SVGCAIRO</span>
<span class="n">SUPPORTS</span><span class="o">=</span><span class="n">ICONV</span> <span class="n">SUPPORTS</span><span class="o">=</span><span class="n">FRIBIDI</span> <span class="n">SUPPORTS</span><span class="o">=</span><span class="n">WMS_SERVER</span>
<span class="n">SUPPORTS</span><span class="o">=</span><span class="n">WMS_CLIENT</span> <span class="n">SUPPORTS</span><span class="o">=</span><span class="n">WFS_SERVER</span> <span class="n">SUPPORTS</span><span class="o">=</span><span class="n">WFS_CLIENT</span>
<span class="n">SUPPORTS</span><span class="o">=</span><span class="n">WCS_SERVER</span> <span class="n">SUPPORTS</span><span class="o">=</span><span class="n">SOS_SERVER</span> <span class="n">SUPPORTS</span><span class="o">=</span><span class="n">FASTCGI</span>
<span class="n">SUPPORTS</span><span class="o">=</span><span class="n">THREADS</span> <span class="n">SUPPORTS</span><span class="o">=</span><span class="n">GEOS</span> <span class="n">SUPPORTS</span><span class="o">=</span><span class="n">POINT_Z_M</span> <span class="n">SUPPORTS</span><span class="o">=</span><span class="n">PBF</span>
<span class="n">INPUT</span><span class="o">=</span><span class="n">JPEG</span> <span class="n">INPUT</span><span class="o">=</span><span class="n">POSTGIS</span> <span class="n">INPUT</span><span class="o">=</span><span class="n">OGR</span> <span class="n">INPUT</span><span class="o">=</span><span class="n">GDAL</span> <span class="n">INPUT</span><span class="o">=</span><span class="n">SHAPEFILE</span>
</pre></div>
</div>
</section>
<section id="step-2-verify-that-your-files-encoding-is-supported-by-iconv">
<h3><a class="toc-backref" href="#table-of-contents" role="doc-backlink">Step 2: Verify That Your Files’ Encoding is Supported by ICONV</a><a class="headerlink" href="#step-2-verify-that-your-files-encoding-is-supported-by-iconv" title="Link to this heading">¶</a></h3>
<p>Since MapServer uses the libiconv library to handle encodings, you can
check the list of supported encodings here:
<a class="reference external" href="https://www.gnu.org/software/libiconv/">https://www.gnu.org/software/libiconv/</a></p>
<p>Unix users can also use the <em>iconv -l</em> command on a system with
libiconv installed to get the complete list of supported encodings on
that specific system.</p>
</section>
<section id="step-3-add-encoding-parameter-to-your-layer-object">
<span id="index-2"></span><h3><a class="toc-backref" href="#table-of-contents" role="doc-backlink">Step 3: Add ENCODING Parameter to your LAYER Object</a><a class="headerlink" href="#step-3-add-encoding-parameter-to-your-layer-object" title="Link to this heading">¶</a></h3>
<p>Now you can simply add the ENCODING parameter to your mapfile LAYER
object, such as:</p>
<div class="highlight-mapfile notranslate"><div class="highlight"><pre><span></span><span class="k">MAP</span>
<span class="p">...</span>
<span class="k">LAYER</span>
<span class="p">...</span>
<span class="k">ENCODING</span> <span class="s">"SHIFT_JIS"</span>
<span class="k">CLASS</span>
<span class="p">...</span>
<span class="k">END</span> <span class="c">#class</span>
<span class="k">END</span> <span class="c">#layer</span>
<span class="k">END</span> <span class="c">#map</span>
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Make sure you save your mapfile in the “UTF-8” encoding in your text editor.</p>
</div>
<div class="highlight-mapfile notranslate"><div class="highlight"><pre><span></span><span class="k">LAYER</span>
<span class="k">NAME</span> <span class="s">"地名"</span>
<span class="k">DATA</span> <span class="s">"chimei.shp"</span>
<span class="k">STATUS</span> <span class="nb">DEFAULT</span>
<span class="k">TYPE</span> <span class="nb">POINT</span>
<span class="k">ENCODING</span> <span class="s">"SHIFT_JIS"</span>
<span class="k">LABELITEM</span> <span class="s">"NAMAE"</span>
<span class="k">CLASS</span>
<span class="k">NAME</span> <span class="s">"地名"</span>
<span class="k">STYLE</span>
<span class="k">COLOR</span> <span class="mi">10</span> <span class="mi">100</span> <span class="mi">100</span>
<span class="k">END</span>
<span class="k">LABEL</span>
<span class="k">TYPE</span> <span class="nb">TRUETYPE</span>
<span class="k">FONT</span> <span class="s">"pgothic"</span>
<span class="k">COLOR</span> <span class="mi">220</span> <span class="mi">20</span> <span class="mi">20</span>
<span class="k">SIZE</span> <span class="mi">7</span>
<span class="k">POSITION</span> <span class="nb">CL</span>
<span class="k">PARTIALS</span> <span class="nb">FALSE</span>
<span class="k">BUFFER</span> <span class="mi">3</span>
<span class="k">END</span>
<span class="k">END</span>
<span class="k">END</span>
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The MapServer 7.6.0 release included an important fix to allow
special characters such as “ä” (umlauts) in filenames and
paths in a mapfile.</p>
</div>
</section>
<section id="step-4-test-with-the-map2img-utility">
<h3><a class="toc-backref" href="#table-of-contents" role="doc-backlink">Step 4: Test with the map2img utility</a><a class="headerlink" href="#step-4-test-with-the-map2img-utility" title="Link to this heading">¶</a></h3>
<ul class="simple">
<li><p>see <a class="reference internal" href="../utilities/map2img.html#map2img"><span class="std std-ref">map2img commandline utility</span></a></p></li>
</ul>
<img alt="../_images/encoding.png" src="../_images/encoding.png" />
</section>
</section>
<section id="id1">
<h2><a class="toc-backref" href="#table-of-contents" role="doc-backlink">How to Enable in Your Mapfile (MapServer < 7.0)</a><a class="headerlink" href="#id1" title="Link to this heading">¶</a></h2>
<p>Older MapServer versions only allowed encoding to be set at the
<a class="reference internal" href="label.html#label"><span class="std std-ref">LABEL</span></a> level in the mapfile.</p>
<section id="add-encoding-parameter-to-your-label-object">
<h3><a class="toc-backref" href="#table-of-contents" role="doc-backlink">Add ENCODING Parameter to your LABEL Object</a><a class="headerlink" href="#add-encoding-parameter-to-your-label-object" title="Link to this heading">¶</a></h3>
<p>Add the ENCODING parameter to your mapfile LABEL
object, such as:</p>
<div class="highlight-mapfile notranslate"><div class="highlight"><pre><span></span><span class="k">MAP</span>
<span class="p">...</span>
<span class="k">LAYER</span>
<span class="p">...</span>
<span class="k">CLASS</span>
<span class="p">...</span>
<span class="k">LABEL</span>
<span class="p">...</span>
<span class="k">ENCODING</span> <span class="s">"SHIFT_JIS"</span>
<span class="k">END</span>
<span class="k">END</span>
<span class="k">END</span>
<span class="k">END</span>
</pre></div>
</div>
<p>Here is an example layer using the encoding set at the LABEL level:</p>
<div class="highlight-mapfile notranslate"><div class="highlight"><pre><span></span><span class="k">LAYER</span>
<span class="k">NAME</span> <span class="s">"chimei"</span>
<span class="k">DATA</span> <span class="s">"chimei.shp"</span>
<span class="k">STATUS</span> <span class="nb">DEFAULT</span>
<span class="k">TYPE</span> <span class="nb">POINT</span>
<span class="k">LABELITEM</span> <span class="s">"NAMAE"</span>
<span class="k">CLASS</span>
<span class="k">NAME</span> <span class="s">"CHIMEI"</span>
<span class="k">STYLE</span>
<span class="k">COLOR</span> <span class="mi">10</span> <span class="mi">100</span> <span class="mi">100</span>
<span class="k">END</span>
<span class="k">LABEL</span>
<span class="k">TYPE</span> <span class="nb">TRUETYPE</span>
<span class="k">FONT</span> <span class="s">"kochi-gothic"</span>
<span class="k">COLOR</span> <span class="mi">220</span> <span class="mi">20</span> <span class="mi">20</span>
<span class="k">SIZE</span> <span class="mi">10</span>
<span class="k">POSITION</span> <span class="nb">CL</span>
<span class="k">PARTIALS</span> <span class="nb">FALSE</span>
<span class="k">BUFFER</span> <span class="mi">0</span>
<span class="k">ENCODING</span> <span class="s">"SHIFT_JIS"</span>
<span class="k">END</span>
<span class="k">END</span>
<span class="k">END</span>
</pre></div>
</div>
</section>
</section>
<section id="example-using-php-mapscript">
<h2><a class="toc-backref" href="#table-of-contents" role="doc-backlink">Example Using PHP MapScript</a><a class="headerlink" href="#example-using-php-mapscript" title="Link to this heading">¶</a></h2>
<p>For PHP Mapscript, the <em>Encoding</em> parameter is included in the
LabelObj Class (for MapServer < 7), so that the encoding parameter of a layer can be
modified such as:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>// Loading the php_mapscript library
dl("php_mapscript.so");
// Loading the map file
$map = ms_newMapObj("example.map");
// get the desired layer
$layer = $map->getLayerByName("chimei");
// get the layer's class object
$class = $layer->getClass(0);
// get the class object's label object
$clabel= $class->label;
// get encoding parameter
$encode_str = $clabel->encoding;
print "Encoding = ".$encode_str."\n";
// set encoding parameter
$clabel->set("encoding","UTF-8");
</pre></div>
</div>
</section>
<section id="notes">
<h2><a class="toc-backref" href="#table-of-contents" role="doc-backlink">Notes</a><a class="headerlink" href="#notes" title="Link to this heading">¶</a></h2>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p id="index-6"><span id="index-5"></span><span id="index-4"></span><span id="index-3"></span>During initial implementation, this functionality was tested using
the different Japanese encoding systems: Shift-JIS, EUC-JP, UTF-8,
as well as Thai’s TIS-620 encoding system.</p>
<p id="index-9"><span id="index-8"></span><span id="index-7"></span>Examples of encodings for the Latin alphabet supported by libiconv
are: ISO-8859-1 (Latin alphabet No. 1 - also known as LATIN-1 -
western European languages), ISO-8859-2 (Latin alphabet No. 2 -
also known as LATIN-2 - eastern European languages), CP1252
(Microsoft Windows Latin alphabet encoding - English and some other
Western languages).</p>
</div>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<search id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script><h3>Navigation</h3>
<p>
<a href="../about.html" title="About">About</a><br>
<a href="../products.html" title="Products">Products</a><br>
<a href="../community/index.html" title="Community">Community</a><br>
<a href="../development/index.html" title="Development">Development</a><br>
<a href="../download.html" title="Downloads">Downloads</a><br>
<a href="../documentation.html" title="Documentation">Documentation</a><br>
<a href="../faq.html" title="FAQ">FAQ</a><br>
<a href="../psc.html" title="PSC">PSC</a><br>
<a href="https://fosstodon.org/@mapserver" title="Mastodon">Mastodon</a>
</p>
<h3>Current Table Of Contents</h3>
<ul>
<li><a class="reference internal" href="#">Display of International Characters in MapServer</a><ul>
<li><a class="reference internal" href="#credit">Credit</a></li>
<li><a class="reference internal" href="#related-links">Related Links</a></li>
<li><a class="reference internal" href="#requirements">Requirements</a></li>
<li><a class="reference internal" href="#how-to-enable-in-your-mapfile-mapserver-7-0">How to Enable in Your Mapfile (MapServer >= 7.0)</a><ul>
<li><a class="reference internal" href="#step-1-verify-iconv-support-and-mapserver-version">Step 1: Verify ICONV Support and MapServer Version</a></li>
<li><a class="reference internal" href="#step-2-verify-that-your-files-encoding-is-supported-by-iconv">Step 2: Verify That Your Files’ Encoding is Supported by ICONV</a></li>
<li><a class="reference internal" href="#step-3-add-encoding-parameter-to-your-layer-object">Step 3: Add ENCODING Parameter to your LAYER Object</a></li>
<li><a class="reference internal" href="#step-4-test-with-the-map2img-utility">Step 4: Test with the map2img utility</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id1">How to Enable in Your Mapfile (MapServer < 7.0)</a><ul>
<li><a class="reference internal" href="#add-encoding-parameter-to-your-label-object">Add ENCODING Parameter to your LABEL Object</a></li>
</ul>
</li>
<li><a class="reference internal" href="#example-using-php-mapscript">Example Using PHP MapScript</a></li>
<li><a class="reference internal" href="#notes">Notes</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="Related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="expressions.html" title="Expressions"
>next</a> |</li>
<li class="right" >
<a href="config.html" title="CONFIG"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Home</a> »</li>
<li class="nav-item nav-item-1"><a href="../documentation.html" >MapServer 8.6.1 Documentation</a> »</li>
<li class="nav-item nav-item-2"><a href="index.html" >Mapfile</a> »</li>
<li class="nav-item nav-item-this"><a href="">Display of International Characters in MapServer</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
© <a href="../copyright.html">Copyright</a> 2026, Open Source Geospatial Foundation.
Last updated on 2026-03-30.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 9.1.0.
</div>
</body>
</html>