~ubuntu-branches/debian/jessie/glib2.0/jessie

« back to all changes in this revision

Viewing changes to docs/reference/glib/html/glib-Character-Set-Conversion.html

Tags: upstream-2.16.1
Import upstream version 2.16.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
<th width="100%" align="center">GLib Reference Manual</th>
37
37
<td><a accesskey="n" href="glib-Unicode-Manipulation.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
38
38
</tr>
39
 
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2867039" class="shortcut">Top</a>
 
39
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2988553" class="shortcut">Top</a>
40
40
                  &#160;|&#160;
41
 
                  <a href="#id2867820" class="shortcut">Description</a></nobr></td></tr>
 
41
                  <a href="#id2989335" class="shortcut">Description</a></nobr></td></tr>
42
42
</table>
43
43
<div class="refentry" lang="en">
44
44
<a name="glib-Character-Set-Conversion"></a><div class="titlepage"></div>
45
45
<div class="refnamediv"><table width="100%"><tr>
46
46
<td valign="top">
47
47
<h2>
48
 
<a name="id2867039"></a><span class="refentrytitle">Character Set Conversion</span>
 
48
<a name="id2988553"></a><span class="refentrytitle">Character Set Conversion</span>
49
49
</h2>
50
50
<p>Character Set Conversion &#8212; convert strings between different character sets using <code class="function">iconv()</code></p>
51
51
</td>
126
126
</pre>
127
127
</div>
128
128
<div class="refsect1" lang="en">
129
 
<a name="id2867820"></a><h2>Description</h2>
 
129
<a name="id2989335"></a><h2>Description</h2>
130
130
<p>
131
131
 
132
132
</p>
254
254
</div>
255
255
</div>
256
256
<div class="refsect1" lang="en">
257
 
<a name="id2868255"></a><h2>Details</h2>
 
257
<a name="id2989769"></a><h2>Details</h2>
258
258
<div class="refsect2" lang="en">
259
 
<a name="id2868265"></a><h3>
 
259
<a name="id2989780"></a><h3>
260
260
<a name="g-convert"></a>g_convert ()</h3>
261
 
<a class="indexterm" name="id2868278"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              g_convert                           (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *str,
 
261
<a class="indexterm" name="id2989792"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              g_convert                           (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *str,
262
262
                                                         <a class="link" href="glib-Basic-Types.html#gssize">gssize</a> len,
263
263
                                                         const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *to_codeset,
264
264
                                                         const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *from_codeset,
334
334
</div>
335
335
<hr>
336
336
<div class="refsect2" lang="en">
337
 
<a name="id2868598"></a><h3>
 
337
<a name="id2990113"></a><h3>
338
338
<a name="g-convert-with-fallback"></a>g_convert_with_fallback ()</h3>
339
 
<a class="indexterm" name="id2868611"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              g_convert_with_fallback             (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *str,
 
339
<a class="indexterm" name="id2990126"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              g_convert_with_fallback             (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *str,
340
340
                                                         <a class="link" href="glib-Basic-Types.html#gssize">gssize</a> len,
341
341
                                                         const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *to_codeset,
342
342
                                                         const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *from_codeset,
425
425
</div>
426
426
<hr>
427
427
<div class="refsect2" lang="en">
428
 
<a name="id2868983"></a><h3>
 
428
<a name="id2990498"></a><h3>
429
429
<a name="GIConv"></a>GIConv</h3>
430
 
<a class="indexterm" name="id2868996"></a><pre class="programlisting">typedef struct _GIConv GIConv;</pre>
 
430
<a class="indexterm" name="id2990511"></a><pre class="programlisting">typedef struct _GIConv GIConv;</pre>
431
431
<p>
432
432
The <span class="structname">GIConv</span> struct wraps an
433
433
<code class="function"><code class="function">iconv()</code></code> conversion descriptor. It contains private data
436
436
</div>
437
437
<hr>
438
438
<div class="refsect2" lang="en">
439
 
<a name="id2869031"></a><h3>
 
439
<a name="id2990545"></a><h3>
440
440
<a name="g-convert-with-iconv"></a>g_convert_with_iconv ()</h3>
441
 
<a class="indexterm" name="id2869044"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              g_convert_with_iconv                (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *str,
 
441
<a class="indexterm" name="id2990559"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              g_convert_with_iconv                (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *str,
442
442
                                                         <a class="link" href="glib-Basic-Types.html#gssize">gssize</a> len,
443
443
                                                         <a class="link" href="glib-Character-Set-Conversion.html#GIConv">GIConv</a> converter,
444
444
                                                         <a class="link" href="glib-Basic-Types.html#gsize">gsize</a> *bytes_read,
508
508
</div>
509
509
<hr>
510
510
<div class="refsect2" lang="en">
511
 
<a name="id2869390"></a><h3>
 
511
<a name="id2990904"></a><h3>
512
512
<a name="G-CONVERT-ERROR:CAPS"></a>G_CONVERT_ERROR</h3>
513
 
<a class="indexterm" name="id2869404"></a><pre class="programlisting">#define G_CONVERT_ERROR g_convert_error_quark()
 
513
<a class="indexterm" name="id2990918"></a><pre class="programlisting">#define G_CONVERT_ERROR g_convert_error_quark()
514
514
</pre>
515
515
<p>
516
516
Error domain for character set conversions. Errors in this domain will
520
520
</div>
521
521
<hr>
522
522
<div class="refsect2" lang="en">
523
 
<a name="id2869437"></a><h3>
 
523
<a name="id2990952"></a><h3>
524
524
<a name="g-iconv-open"></a>g_iconv_open ()</h3>
525
 
<a class="indexterm" name="id2869449"></a><pre class="programlisting"><a class="link" href="glib-Character-Set-Conversion.html#GIConv">GIConv</a>              g_iconv_open                        (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *to_codeset,
 
525
<a class="indexterm" name="id2990964"></a><pre class="programlisting"><a class="link" href="glib-Character-Set-Conversion.html#GIConv">GIConv</a>              g_iconv_open                        (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *to_codeset,
526
526
                                                         const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *from_codeset);</pre>
527
527
<p>
528
528
Same as the standard UNIX routine <code class="function">iconv_open()</code>, but
559
559
</div>
560
560
<hr>
561
561
<div class="refsect2" lang="en">
562
 
<a name="id2869572"></a><h3>
 
562
<a name="id2991087"></a><h3>
563
563
<a name="g-iconv"></a>g_iconv ()</h3>
564
 
<a class="indexterm" name="id2869585"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gsize">gsize</a>               g_iconv                             (<a class="link" href="glib-Character-Set-Conversion.html#GIConv">GIConv</a> converter,
 
564
<a class="indexterm" name="id2991100"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gsize">gsize</a>               g_iconv                             (<a class="link" href="glib-Character-Set-Conversion.html#GIConv">GIConv</a> converter,
565
565
                                                         <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> **inbuf,
566
566
                                                         <a class="link" href="glib-Basic-Types.html#gsize">gsize</a> *inbytes_left,
567
567
                                                         <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> **outbuf,
615
615
</div>
616
616
<hr>
617
617
<div class="refsect2" lang="en">
618
 
<a name="id2869795"></a><h3>
 
618
<a name="id2991309"></a><h3>
619
619
<a name="g-iconv-close"></a>g_iconv_close ()</h3>
620
 
<a class="indexterm" name="id2869808"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint">gint</a>                g_iconv_close                       (<a class="link" href="glib-Character-Set-Conversion.html#GIConv">GIConv</a> converter);</pre>
 
620
<a class="indexterm" name="id2991322"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint">gint</a>                g_iconv_close                       (<a class="link" href="glib-Character-Set-Conversion.html#GIConv">GIConv</a> converter);</pre>
621
621
<p>
622
622
Same as the standard UNIX routine <code class="function">iconv_close()</code>, but
623
623
may be implemented via libiconv on UNIX flavors that lack
649
649
</div>
650
650
<hr>
651
651
<div class="refsect2" lang="en">
652
 
<a name="id2869930"></a><h3>
 
652
<a name="id2991445"></a><h3>
653
653
<a name="g-locale-to-utf8"></a>g_locale_to_utf8 ()</h3>
654
 
<a class="indexterm" name="id2869943"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              g_locale_to_utf8                    (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *opsysstring,
 
654
<a class="indexterm" name="id2991458"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              g_locale_to_utf8                    (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *opsysstring,
655
655
                                                         <a class="link" href="glib-Basic-Types.html#gssize">gssize</a> len,
656
656
                                                         <a class="link" href="glib-Basic-Types.html#gsize">gsize</a> *bytes_read,
657
657
                                                         <a class="link" href="glib-Basic-Types.html#gsize">gsize</a> *bytes_written,
713
713
</div>
714
714
<hr>
715
715
<div class="refsect2" lang="en">
716
 
<a name="id2870175"></a><h3>
 
716
<a name="id2991689"></a><h3>
717
717
<a name="g-filename-to-utf8"></a>g_filename_to_utf8 ()</h3>
718
 
<a class="indexterm" name="id2870188"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              g_filename_to_utf8                  (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *opsysstring,
 
718
<a class="indexterm" name="id2991703"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              g_filename_to_utf8                  (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *opsysstring,
719
719
                                                         <a class="link" href="glib-Basic-Types.html#gssize">gssize</a> len,
720
720
                                                         <a class="link" href="glib-Basic-Types.html#gsize">gsize</a> *bytes_read,
721
721
                                                         <a class="link" href="glib-Basic-Types.html#gsize">gsize</a> *bytes_written,
776
776
</div>
777
777
<hr>
778
778
<div class="refsect2" lang="en">
779
 
<a name="id2870417"></a><h3>
 
779
<a name="id2991931"></a><h3>
780
780
<a name="g-filename-from-utf8"></a>g_filename_from_utf8 ()</h3>
781
 
<a class="indexterm" name="id2870430"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              g_filename_from_utf8                (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *utf8string,
 
781
<a class="indexterm" name="id2991945"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              g_filename_from_utf8                (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *utf8string,
782
782
                                                         <a class="link" href="glib-Basic-Types.html#gssize">gssize</a> len,
783
783
                                                         <a class="link" href="glib-Basic-Types.html#gsize">gsize</a> *bytes_read,
784
784
                                                         <a class="link" href="glib-Basic-Types.html#gsize">gsize</a> *bytes_written,
839
839
</div>
840
840
<hr>
841
841
<div class="refsect2" lang="en">
842
 
<a name="id2870653"></a><h3>
 
842
<a name="id2992168"></a><h3>
843
843
<a name="g-filename-from-uri"></a>g_filename_from_uri ()</h3>
844
 
<a class="indexterm" name="id2870667"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              g_filename_from_uri                 (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *uri,
 
844
<a class="indexterm" name="id2992182"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              g_filename_from_uri                 (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *uri,
845
845
                                                         <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> **hostname,
846
846
                                                         <a class="link" href="glib-Error-Reporting.html#GError">GError</a> **error);</pre>
847
847
<p>
882
882
</div>
883
883
<hr>
884
884
<div class="refsect2" lang="en">
885
 
<a name="id2870826"></a><h3>
 
885
<a name="id2992340"></a><h3>
886
886
<a name="g-filename-to-uri"></a>g_filename_to_uri ()</h3>
887
 
<a class="indexterm" name="id2870839"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              g_filename_to_uri                   (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *filename,
 
887
<a class="indexterm" name="id2992354"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              g_filename_to_uri                   (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *filename,
888
888
                                                         const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *hostname,
889
889
                                                         <a class="link" href="glib-Error-Reporting.html#GError">GError</a> **error);</pre>
890
890
<p>
925
925
</div>
926
926
<hr>
927
927
<div class="refsect2" lang="en">
928
 
<a name="id2870989"></a><h3>
 
928
<a name="id2992504"></a><h3>
929
929
<a name="g-get-filename-charsets"></a>g_get_filename_charsets ()</h3>
930
 
<a class="indexterm" name="id2871004"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            g_get_filename_charsets             (G_CONST_RETURN <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> ***charsets);</pre>
 
930
<a class="indexterm" name="id2992519"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            g_get_filename_charsets             (G_CONST_RETURN <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> ***charsets);</pre>
931
931
<p>
932
932
Determines the preferred character sets used for filenames.
933
933
The first character set from the <em class="parameter"><code>charsets</code></em> is the filename encoding, the
982
982
</div>
983
983
<hr>
984
984
<div class="refsect2" lang="en">
985
 
<a name="id2871177"></a><h3>
 
985
<a name="id2992692"></a><h3>
986
986
<a name="g-filename-display-name"></a>g_filename_display_name ()</h3>
987
 
<a class="indexterm" name="id2871193"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              g_filename_display_name             (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *filename);</pre>
 
987
<a class="indexterm" name="id2992708"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              g_filename_display_name             (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *filename);</pre>
988
988
<p>
989
989
Converts a filename into a valid UTF-8 string. The conversion is 
990
990
not necessarily reversible, so you should keep the original around 
1028
1028
</div>
1029
1029
<hr>
1030
1030
<div class="refsect2" lang="en">
1031
 
<a name="id2871326"></a><h3>
 
1031
<a name="id2992840"></a><h3>
1032
1032
<a name="g-filename-display-basename"></a>g_filename_display_basename ()</h3>
1033
 
<a class="indexterm" name="id2871341"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              g_filename_display_basename         (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *filename);</pre>
 
1033
<a class="indexterm" name="id2992856"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              g_filename_display_basename         (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *filename);</pre>
1034
1034
<p>
1035
1035
Returns the display basename for the particular filename, guaranteed
1036
1036
to be valid UTF-8. The display name might not be identical to the filename,
1076
1076
</div>
1077
1077
<hr>
1078
1078
<div class="refsect2" lang="en">
1079
 
<a name="id2871456"></a><h3>
 
1079
<a name="id2992970"></a><h3>
1080
1080
<a name="g-uri-list-extract-uris"></a>g_uri_list_extract_uris ()</h3>
1081
 
<a class="indexterm" name="id2871471"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>**             g_uri_list_extract_uris             (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *uri_list);</pre>
 
1081
<a class="indexterm" name="id2992985"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>**             g_uri_list_extract_uris             (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *uri_list);</pre>
1082
1082
<p>
1083
1083
Splits an URI list conforming to the text/uri-list
1084
1084
mime type defined in RFC 2483 into individual URIs,
1109
1109
</div>
1110
1110
<hr>
1111
1111
<div class="refsect2" lang="en">
1112
 
<a name="id2871562"></a><h3>
 
1112
<a name="id2993077"></a><h3>
1113
1113
<a name="g-locale-from-utf8"></a>g_locale_from_utf8 ()</h3>
1114
 
<a class="indexterm" name="id2871575"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              g_locale_from_utf8                  (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *utf8string,
 
1114
<a class="indexterm" name="id2993090"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gchar">gchar</a>*              g_locale_from_utf8                  (const <a class="link" href="glib-Basic-Types.html#gchar">gchar</a> *utf8string,
1115
1115
                                                         <a class="link" href="glib-Basic-Types.html#gssize">gssize</a> len,
1116
1116
                                                         <a class="link" href="glib-Basic-Types.html#gsize">gsize</a> *bytes_read,
1117
1117
                                                         <a class="link" href="glib-Basic-Types.html#gsize">gsize</a> *bytes_written,
1172
1172
</div>
1173
1173
<hr>
1174
1174
<div class="refsect2" lang="en">
1175
 
<a name="id2871804"></a><h3>
 
1175
<a name="id2993319"></a><h3>
1176
1176
<a name="GConvertError"></a>enum GConvertError</h3>
1177
 
<a class="indexterm" name="id2871817"></a><pre class="programlisting">typedef enum 
 
1177
<a class="indexterm" name="id2993332"></a><pre class="programlisting">typedef enum 
1178
1178
{
1179
1179
  G_CONVERT_ERROR_NO_CONVERSION,
1180
1180
  G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
1227
1227
</div>
1228
1228
<hr>
1229
1229
<div class="refsect2" lang="en">
1230
 
<a name="id2871983"></a><h3>
 
1230
<a name="id2993497"></a><h3>
1231
1231
<a name="g-get-charset"></a>g_get_charset ()</h3>
1232
 
<a class="indexterm" name="id2871996"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            g_get_charset                       (G_CONST_RETURN char **charset);</pre>
 
1232
<a class="indexterm" name="id2993510"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean">gboolean</a>            g_get_charset                       (G_CONST_RETURN char **charset);</pre>
1233
1233
<p>
1234
1234
Obtains the character set for the <a class="link" href="glib-running.html#setlocale" title="Locale">current 
1235
1235
locale</a>; you might use this character set as an argument to 
1272
1272
</div>
1273
1273
</div>
1274
1274
<div class="refsect1" lang="en">
1275
 
<a name="id2872153"></a><div class="refsect2" lang="en"><a name="id2872154"></a></div>
 
1275
<a name="id2993668"></a><div class="refsect2" lang="en"><a name="id2993669"></a></div>
1276
1276
<hr>
1277
 
<div class="refsect2" lang="en"><a name="id2872155"></a></div>
 
1277
<div class="refsect2" lang="en"><a name="id2993670"></a></div>
1278
1278
</div>
1279
1279
<div class="footnotes">
1280
1280
<br><hr width="100" align="left">