1 '\" te
2 .\" Copyright (c) 2007, Sun Microsystems, Inc., All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH KICONV_OPEN 9F "Oct 16, 2007"
7 .SH NAME
8 kiconv_open \- code conversion descriptor allocation function
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/sunddi.h>
13
14
15
16 \fBkiconv_t\fR \fBkiconv_open\fR(\fBconst\fR \fBchar *\fR\fItocode\fR, \fBconst\fR \fBchar *\fR\fIfromcode\fR);
17 .fi
18
19 .SH INTERFACE LEVEL
20 .sp
21 .LP
22 Solaris DDI specific (Solaris DDI).
23 .SH PARAMETERS
24 .sp
25 .ne 2
26 .na
135 PCK, SJIS Shift_JIS
136 .fi
137 .in -2
138 .sp
139
140 .sp
141 .LP
142 A conversion descriptor remains valid until it is closed by using
143 \fBkiconv_close()\fR.
144 .SH RETURN VALUES
145 .sp
146 .LP
147 Upon successful completion, \fBkiconv_open()\fR returns a code conversion
148 descriptor for use on subsequent calls to \fBkiconv()\fR. Otherwise, if the
149 conversion specified by \fIfromcode\fR and \fItocode\fR is not supported or for
150 any other reasons the code conversion descriptor cannot be allocated,
151 \fBkiconv_open()\fR returns (\fBkiconv_t\fR)-1 to indicate the error.
152 .SH CONTEXT
153 .sp
154 .LP
155 \fBkiconv_close()\fR can be called from user context only.
156 .SH EXAMPLES
157 .LP
158 \fBExample 1 \fROpening a Code Conversion
159 .sp
160 .LP
161 The following example shows how to open a code conversion from \fBISO\fR
162 8859-15 to \fBUTF-8\fR
163
164 .sp
165 .in +2
166 .nf
167 #include <sys/sunddi.h>
168
169 kiconv_t cd;
170
171 cd = kiconv_open("UTF-8", "ISO-8859-15");
172 if (cd == (kiconv_t)-1) {
173 /* Cannot open up the code conversion. */
174 return (-1);
175 }
|
1 '\" te
2 .\" Copyright (c) 2007, Sun Microsystems, Inc., All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH KICONV_OPEN 9F "Nov 5, 2013"
7 .SH NAME
8 kiconv_open \- code conversion descriptor allocation function
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/sunddi.h>
13
14
15
16 \fBkiconv_t\fR \fBkiconv_open\fR(\fBconst\fR \fBchar *\fR\fItocode\fR, \fBconst\fR \fBchar *\fR\fIfromcode\fR);
17 .fi
18
19 .SH INTERFACE LEVEL
20 .sp
21 .LP
22 Solaris DDI specific (Solaris DDI).
23 .SH PARAMETERS
24 .sp
25 .ne 2
26 .na
135 PCK, SJIS Shift_JIS
136 .fi
137 .in -2
138 .sp
139
140 .sp
141 .LP
142 A conversion descriptor remains valid until it is closed by using
143 \fBkiconv_close()\fR.
144 .SH RETURN VALUES
145 .sp
146 .LP
147 Upon successful completion, \fBkiconv_open()\fR returns a code conversion
148 descriptor for use on subsequent calls to \fBkiconv()\fR. Otherwise, if the
149 conversion specified by \fIfromcode\fR and \fItocode\fR is not supported or for
150 any other reasons the code conversion descriptor cannot be allocated,
151 \fBkiconv_open()\fR returns (\fBkiconv_t\fR)-1 to indicate the error.
152 .SH CONTEXT
153 .sp
154 .LP
155 \fBkiconv_open()\fR can be called from user context only.
156 .SH EXAMPLES
157 .LP
158 \fBExample 1 \fROpening a Code Conversion
159 .sp
160 .LP
161 The following example shows how to open a code conversion from \fBISO\fR
162 8859-15 to \fBUTF-8\fR
163
164 .sp
165 .in +2
166 .nf
167 #include <sys/sunddi.h>
168
169 kiconv_t cd;
170
171 cd = kiconv_open("UTF-8", "ISO-8859-15");
172 if (cd == (kiconv_t)-1) {
173 /* Cannot open up the code conversion. */
174 return (-1);
175 }
|