4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #pragma ident "%Z%%M% %I% %E% SMI"
29 * Kernel iconv code conversion module (kiconv_emea) for Europe, Middle East,
30 * and South East Asia (PSARC/2007/173).
33 #include <sys/types.h>
34 #include <sys/param.h>
35 #include <sys/sysmacros.h>
36 #include <sys/systm.h>
37 #include <sys/debug.h>
39 #include <sys/cmn_err.h>
41 #include <sys/sunddi.h>
42 #include <sys/ksynch.h>
43 #include <sys/modctl.h>
44 #include <sys/byteorder.h>
45 #include <sys/errno.h>
46 #include <sys/kiconv.h>
47 #include <sys/kiconv_emea1.h>
48 #include <sys/kiconv_emea2.h>
52 * The following macros indicate ids to the correct code conversion mapping
53 * data tables to use. The actual tables are coming from <sys/kiconv_emea1.h>
54 * and <sys/kiconv_emea2.h>. If you update the header files, then, you might
55 * also need to update the table ids at below.
57 * The table for KICONV_TBLID_720 is a special case and should come from
58 * a separate header file than others at <sys/kiconv_emea1.h> hence it has
59 * an id that is rather unusual distinguishing itself from others. (And,
60 * the ids much be of uint8_t.)
62 #define KICONV_TBLID_720 (0xFFU)
63 #define KICONV_TBLID_RANGE1_START KICONV_TBLID_720
64 #define KICONV_TBLID_RANGE1_END KICONV_TBLID_720
66 #define KICONV_TBLID_737 (0)
67 #define KICONV_TBLID_852 (1)
68 #define KICONV_TBLID_857 (2)
69 #define KICONV_TBLID_862 (3)
70 #define KICONV_TBLID_866 (4)
71 #define KICONV_TBLID_1250 (5)
72 #define KICONV_TBLID_1251 (6)
73 #define KICONV_TBLID_1253 (7)
74 #define KICONV_TBLID_1254 (8)
75 #define KICONV_TBLID_1255 (9)
76 #define KICONV_TBLID_1256 (10)
77 #define KICONV_TBLID_1257 (11)
78 #define KICONV_TBLID_8859_2 (12)
79 #define KICONV_TBLID_8859_3 (13)
80 #define KICONV_TBLID_8859_4 (14)
81 #define KICONV_TBLID_8859_5 (15)
82 #define KICONV_TBLID_8859_6 (16)
83 #define KICONV_TBLID_8859_7 (17)
84 #define KICONV_TBLID_8859_8 (18)
85 #define KICONV_TBLID_8859_9 (19)
86 #define KICONV_TBLID_8859_10 (20)
87 #define KICONV_TBLID_8859_11 (21)
88 #define KICONV_TBLID_8859_13 (22)
89 #define KICONV_TBLID_KOI8_R (23)
91 #define KICONV_MAX_MAPPING_TBLID KICONV_TBLID_KOI8_R
94 * The following tables are coming from u8_textprep.c. We use them to
95 * check on validity of UTF-8 characters and their bytes.
97 extern const int8_t u8_number_of_bytes
[];
98 extern const uint8_t u8_valid_min_2nd_byte
[];
99 extern const uint8_t u8_valid_max_2nd_byte
[];
103 * The following 25 open_to_xxxx() functions are kiconv_open functions for
104 * the conversions from UTF-8 to xxxx single byte codesets.
111 s
= (kiconv_state_t
)kmem_alloc(sizeof (kiconv_state_data_t
), KM_SLEEP
);
112 s
->id
= KICONV_TBLID_720
;
113 s
->bom_processed
= 0;
123 s
= (kiconv_state_t
)kmem_alloc(sizeof (kiconv_state_data_t
), KM_SLEEP
);
124 s
->id
= KICONV_TBLID_737
;
125 s
->bom_processed
= 0;
135 s
= (kiconv_state_t
)kmem_alloc(sizeof (kiconv_state_data_t
), KM_SLEEP
);
136 s
->id
= KICONV_TBLID_852
;
137 s
->bom_processed
= 0;
147 s
= (kiconv_state_t
)kmem_alloc(sizeof (kiconv_state_data_t
), KM_SLEEP
);
148 s
->id
= KICONV_TBLID_857
;
149 s
->bom_processed
= 0;
159 s
= (kiconv_state_t
)kmem_alloc(sizeof (kiconv_state_data_t
), KM_SLEEP
);
160 s
->id
= KICONV_TBLID_862
;
161 s
->bom_processed
= 0;
171 s
= (kiconv_state_t
)kmem_alloc(sizeof (kiconv_state_data_t
), KM_SLEEP
);
172 s
->id
= KICONV_TBLID_866
;
173 s
->bom_processed
= 0;
183 s
= (kiconv_state_t
)kmem_alloc(sizeof (kiconv_state_data_t
), KM_SLEEP
);
184 s
->id
= KICONV_TBLID_1250
;
185 s
->bom_processed
= 0;
195 s
= (kiconv_state_t
)kmem_alloc(sizeof (kiconv_state_data_t
), KM_SLEEP
);
196 s
->id
= KICONV_TBLID_1251
;
197 s
->bom_processed
= 0;
207 s
= (kiconv_state_t
)kmem_alloc(sizeof (kiconv_state_data_t
), KM_SLEEP
);
208 s
->id
= KICONV_TBLID_1253
;
209 s
->bom_processed
= 0;
219 s
= (kiconv_state_t
)kmem_alloc(sizeof (kiconv_state_data_t
), KM_SLEEP
);
220 s
->id
= KICONV_TBLID_1254
;
221 s
->bom_processed
= 0;
231 s
= (kiconv_state_t
)kmem_alloc(sizeof (kiconv_state_data_t
), KM_SLEEP
);
232 s
->id
= KICONV_TBLID_1255
;
233 s
->bom_processed
= 0;
243 s
= (kiconv_state_t
)kmem_alloc(sizeof (kiconv_state_data_t
), KM_SLEEP
);
244 s
->id
= KICONV_TBLID_1256
;
245 s
->bom_processed
= 0;
255 s
= (kiconv_state_t
)kmem_alloc(sizeof (kiconv_state_data_t
), KM_SLEEP
);
256 s
->id
= KICONV_TBLID_1257
;
257 s
->bom_processed
= 0;
267 s
= (kiconv_state_t
)kmem_alloc(sizeof (kiconv_state_data_t
), KM_SLEEP
);
268 s
->id
= KICONV_TBLID_8859_2
;
269 s
->bom_processed
= 0;
279 s
= (kiconv_state_t
)kmem_alloc(sizeof (kiconv_state_data_t
), KM_SLEEP
);
280 s
->id
= KICONV_TBLID_8859_3
;
281 s
->bom_processed
= 0;
291 s
= (kiconv_state_t
)kmem_alloc(sizeof (kiconv_state_data_t
), KM_SLEEP
);
292 s
->id
= KICONV_TBLID_8859_4
;
293 s
->bom_processed
= 0;
303 s
= (kiconv_state_t
)kmem_alloc(sizeof (kiconv_state_data_t
), KM_SLEEP
);
304 s
->id
= KICONV_TBLID_8859_5
;
305 s
->bom_processed
= 0;
315 s
= (kiconv_state_t
)kmem_alloc(sizeof (kiconv_state_data_t
), KM_SLEEP
);
316 s
->id
= KICONV_TBLID_8859_6
;
317 s
->bom_processed
= 0;
327 s
= (kiconv_state_t
)kmem_alloc(sizeof (kiconv_state_data_t
), KM_SLEEP
);
328 s
->id
= KICONV_TBLID_8859_7
;
329 s
->bom_processed
= 0;
339 s
= (kiconv_state_t
)kmem_alloc(sizeof (kiconv_state_data_t
), KM_SLEEP
);
340 s
->id
= KICONV_TBLID_8859_8
;
341 s
->bom_processed
= 0;
351 s
= (kiconv_state_t
)kmem_alloc(sizeof (kiconv_state_data_t
), KM_SLEEP
);
352 s
->id
= KICONV_TBLID_8859_9
;
353 s
->bom_processed
= 0;
363 s
= (kiconv_state_t
)kmem_alloc(sizeof (kiconv_state_data_t
), KM_SLEEP
);
364 s
->id
= KICONV_TBLID_8859_10
;
365 s
->bom_processed
= 0;
375 s
= (kiconv_state_t
)kmem_alloc(sizeof (kiconv_state_data_t
), KM_SLEEP
);
376 s
->id
= KICONV_TBLID_8859_11
;
377 s
->bom_processed
= 0;
387 s
= (kiconv_state_t
)kmem_alloc(sizeof (kiconv_state_data_t
), KM_SLEEP
);
388 s
->id
= KICONV_TBLID_8859_13
;
389 s
->bom_processed
= 0;
399 s
= (kiconv_state_t
)kmem_alloc(sizeof (kiconv_state_data_t
), KM_SLEEP
);
400 s
->id
= KICONV_TBLID_KOI8_R
;
401 s
->bom_processed
= 0;
407 * The following 25 open_fr_xxxx() functions are kiconv_open functions for
408 * the conversions from xxxx single byte codeset to UTF-8.
413 return ((void *)KICONV_TBLID_720
);
419 return ((void *)KICONV_TBLID_737
);
425 return ((void *)KICONV_TBLID_852
);
431 return ((void *)KICONV_TBLID_857
);
437 return ((void *)KICONV_TBLID_862
);
443 return ((void *)KICONV_TBLID_866
);
449 return ((void *)KICONV_TBLID_1250
);
455 return ((void *)KICONV_TBLID_1251
);
461 return ((void *)KICONV_TBLID_1253
);
467 return ((void *)KICONV_TBLID_1254
);
473 return ((void *)KICONV_TBLID_1255
);
479 return ((void *)KICONV_TBLID_1256
);
485 return ((void *)KICONV_TBLID_1257
);
491 return ((void *)KICONV_TBLID_8859_2
);
497 return ((void *)KICONV_TBLID_8859_3
);
503 return ((void *)KICONV_TBLID_8859_4
);
509 return ((void *)KICONV_TBLID_8859_5
);
515 return ((void *)KICONV_TBLID_8859_6
);
521 return ((void *)KICONV_TBLID_8859_7
);
527 return ((void *)KICONV_TBLID_8859_8
);
533 return ((void *)KICONV_TBLID_8859_9
);
539 return ((void *)KICONV_TBLID_8859_10
);
545 return ((void *)KICONV_TBLID_8859_11
);
551 return ((void *)KICONV_TBLID_8859_13
);
557 return ((void *)KICONV_TBLID_KOI8_R
);
561 * The following is the common kiconv_close function for the conversions from
562 * UTF-8 to single byte codesets.
567 if (! s
|| s
== (void *)-1)
570 kmem_free(s
, sizeof (kiconv_state_data_t
));
576 * The following is the common kiconv_close function for the conversions from
577 * single byte codesets to UTF-8.
582 if ((ulong_t
)s
> KICONV_MAX_MAPPING_TBLID
&&
583 ((ulong_t
)s
< KICONV_TBLID_RANGE1_START
||
584 (ulong_t
)s
> KICONV_TBLID_RANGE1_END
))
591 * The following is the common kiconv function for the conversions from
592 * UTF-8 to single byte codesets. (This may look a lot similar to
593 * kiconvstr_to_sb() but they do have different features to cover and
594 * it's not really worth to try to merge them into a single function since
595 * you'll have to add performance penalty for both per each character
596 * conversion as you will have to figure out if this is kiconv_to_sb() or
597 * kiconvstr_to_sb().)
600 kiconv_to_sb(void *kcd
, char **inbuf
, size_t *inbytesleft
, char **outbuf
,
601 size_t *outbytesleft
, int *errno
)
603 kiconv_to_sb_tbl_comp_t
*tbl
;
619 /* Check on the kiconv code conversion descriptor. */
620 if (! kcd
|| kcd
== (void *)-1) {
625 /* Get the table id and check on it. */
626 id
= ((kiconv_state_t
)kcd
)->id
;
627 if (id
> KICONV_MAX_MAPPING_TBLID
&&
628 (id
< KICONV_TBLID_RANGE1_START
|| id
> KICONV_TBLID_RANGE1_END
)) {
633 /* If this is a state reset request, process and return. */
634 if (! inbuf
|| ! (*inbuf
)) {
635 ((kiconv_state_t
)kcd
)->bom_processed
= 0;
640 ib
= (uchar_t
*)*inbuf
;
641 ob
= (uchar_t
*)*outbuf
;
642 ibtail
= ib
+ *inbytesleft
;
643 obtail
= ob
+ *outbytesleft
;
646 * Get the table we want to use and also calculate the "init_h"
647 * which is the initial high index for the binary search that we will
648 * use. While the table sizes are all the same at the moment, to be
649 * ready for future cases where tables could be in different sizes,
650 * we separately calculate the init_h at here.
652 if (id
== KICONV_TBLID_720
) {
653 tbl
= (kiconv_to_sb_tbl_comp_t
*)u8_to_cp720_tbl
;
654 init_h
= sizeof (u8_to_cp720_tbl
);
656 tbl
= (kiconv_to_sb_tbl_comp_t
*)to_sb_tbl
[id
];
657 init_h
= sizeof (to_sb_tbl
[id
]);
659 init_h
= init_h
/ sizeof (kiconv_to_sb_tbl_comp_t
) - 1;
662 * If we haven't checked on the UTF-8 signature BOM character in
663 * the beginning of the conversion data stream, we check it and if
664 * find one, we skip it since we have no use for it.
666 if (((kiconv_state_t
)kcd
)->bom_processed
== 0 && (ibtail
- ib
) >= 3 &&
667 *ib
== 0xef && *(ib
+ 1) == 0xbb && *(ib
+ 2) == 0xbf)
669 ((kiconv_state_t
)kcd
)->bom_processed
= 1;
671 while (ib
< ibtail
) {
672 sz
= u8_number_of_bytes
[*ib
];
675 ret_val
= (size_t)-1;
680 * If there is no room to write at the output buffer,
681 * we issue E2BIG and let the caller knows about it.
685 ret_val
= (size_t)-1;
690 * If it is a 7-bit ASCII character, we don't need to
691 * process further and we just copy the character over.
693 * If not, we collect the character bytes up to four bytes,
694 * validate the bytes, and binary search for the corresponding
695 * single byte codeset character byte. If we find it from
696 * the mapping table, we put that into the output buffer;
697 * otherwise, we put a replacement character instead as
698 * a non-identical conversion.
706 * Issue EINVAL if the last character at the input buffer
707 * is an incomplete character missing a byte or more.
709 if ((ibtail
- ib
) < sz
) {
711 ret_val
= (size_t)-1;
716 * We collect UTF-8 character bytes and at the same time,
717 * check on if the bytes are valid bytes or not. This follows
718 * the latest UTF-8 byte representation.
723 for (i
= 1; i
< sz
; i
++) {
725 if (*ib
< u8_valid_min_2nd_byte
[u8
] ||
726 *ib
> u8_valid_max_2nd_byte
[u8
]) {
728 ret_val
= (size_t)-1;
730 goto TO_SB_ILLEGAL_CHAR_ERR
;
733 } else if (*ib
< 0x80 || *ib
> 0xbf) {
735 ret_val
= (size_t)-1;
737 goto TO_SB_ILLEGAL_CHAR_ERR
;
739 u8
= (u8
<< 8) | ((uint32_t)*ib
);
749 else if (tbl
[i
].u8
< u8
)
755 if (tbl
[i
].u8
== u8
) {
759 * What this means is that we encountered
760 * a non-identical conversion. In other words,
761 * input buffer contains a valid character in
762 * the fromcode but the tocode doesn't have
763 * any character that can be mapped to.
765 * In this case, we insert an ASCII replacement
766 * character instead at the output buffer and
767 * count such non-identical conversions by
768 * increasing the ret_val.
770 * If the return value of the function is bigger
771 * than zero, that means we had such non-identical
774 *ob
++ = KICONV_ASCII_REPLACEMENT_CHAR
;
779 TO_SB_ILLEGAL_CHAR_ERR
:
781 *inbytesleft
= ibtail
- ib
;
782 *outbuf
= (char *)ob
;
783 *outbytesleft
= obtail
- ob
;
789 * The following is the common kiconv function for the conversions from
790 * single byte codesets to UTf-8.
793 kiconv_fr_sb(void *kcd
, char **inbuf
, size_t *inbytesleft
, char **outbuf
,
794 size_t *outbytesleft
, int *errno
)
796 kiconv_to_utf8_tbl_comp_t
*tbl
;
806 /* Validate the kiconv code conversion descriptor. */
807 if ((ulong_t
)kcd
> KICONV_MAX_MAPPING_TBLID
&&
808 ((ulong_t
)kcd
< KICONV_TBLID_RANGE1_START
||
809 (ulong_t
)kcd
> KICONV_TBLID_RANGE1_END
)) {
815 * If this is a state reset request, there is nothing to do and so
818 if (! inbuf
|| ! (*inbuf
))
822 ib
= (uchar_t
*)*inbuf
;
823 ob
= (uchar_t
*)*outbuf
;
824 ibtail
= ib
+ *inbytesleft
;
825 obtail
= ob
+ *outbytesleft
;
827 tbl
= ((ulong_t
)kcd
== KICONV_TBLID_720
) ?
828 (kiconv_to_utf8_tbl_comp_t
*)cp720_to_u8_tbl
:
829 (kiconv_to_utf8_tbl_comp_t
*)to_u8_tbl
[(ulong_t
)kcd
];
831 while (ib
< ibtail
) {
833 * If this is a 7-bit ASCII character, we just copy over and
834 * that's all we need to do for this character.
839 ret_val
= (size_t)-1;
848 * Otherwise, we get the corresponding UTF-8 character bytes
849 * from the mapping table and copy them over.
851 * We don't need to worry about if the UTF-8 character bytes
852 * at the mapping tables are valid or not since they are good.
855 sz
= u8_number_of_bytes
[tbl
[k
].u8
[0]];
858 * If (sz <= 0), that means the character in the input buffer
859 * is an illegal character possibly unassigned or non-character
860 * at the fromcode single byte codeset.
864 ret_val
= (size_t)-1;
868 if ((obtail
- ob
) < sz
) {
870 ret_val
= (size_t)-1;
874 for (i
= 0; i
< sz
; i
++)
875 *ob
++ = tbl
[k
].u8
[i
];
881 *inbytesleft
= ibtail
- ib
;
882 *outbuf
= (char *)ob
;
883 *outbytesleft
= obtail
- ob
;
889 * The following is the common kiconvstr function for the conversions from
890 * UTF-8 to single byte codeset.
893 kiconvstr_to_sb(size_t id
, uchar_t
*ib
, size_t *inlen
, uchar_t
*ob
,
894 size_t *outlen
, int flag
, int *errno
)
896 kiconv_to_sb_tbl_comp_t
*tbl
;
908 boolean_t do_not_ignore_null
;
910 /* Let's double check on the table id. */
911 if (id
> KICONV_MAX_MAPPING_TBLID
&&
912 (id
< KICONV_TBLID_RANGE1_START
|| id
> KICONV_TBLID_RANGE1_END
)) {
918 ibtail
= ib
+ *inlen
;
919 obtail
= ob
+ *outlen
;
920 do_not_ignore_null
= ((flag
& KICONV_IGNORE_NULL
) == 0);
922 if (id
== KICONV_TBLID_720
) {
923 tbl
= (kiconv_to_sb_tbl_comp_t
*)u8_to_cp720_tbl
;
924 init_h
= sizeof (u8_to_cp720_tbl
);
926 tbl
= (kiconv_to_sb_tbl_comp_t
*)to_sb_tbl
[id
];
927 init_h
= sizeof (to_sb_tbl
[id
]);
929 init_h
= init_h
/ sizeof (kiconv_to_sb_tbl_comp_t
) - 1;
931 /* Skip any UTF-8 signature BOM character in the beginning. */
932 if ((ibtail
- ib
) >= 3 && *ib
== 0xef && *(ib
+ 1) == 0xbb &&
937 * Basically this is pretty much the same as kiconv_to_sb() except
938 * that we are now accepting two flag values and doing the processing
941 while (ib
< ibtail
) {
942 sz
= u8_number_of_bytes
[*ib
];
944 if (flag
& KICONV_REPLACE_INVALID
) {
947 ret_val
= (size_t)-1;
952 goto STR_TO_SB_REPLACE_INVALID
;
956 ret_val
= (size_t)-1;
960 if (*ib
== '\0' && do_not_ignore_null
)
965 ret_val
= (size_t)-1;
974 if ((ibtail
- ib
) < sz
) {
975 if (flag
& KICONV_REPLACE_INVALID
) {
977 goto STR_TO_SB_REPLACE_INVALID
;
981 ret_val
= (size_t)-1;
988 for (i
= 1; i
< sz
; i
++) {
990 if (*ib
< u8_valid_min_2nd_byte
[u8
] ||
991 *ib
> u8_valid_max_2nd_byte
[u8
]) {
992 if (flag
& KICONV_REPLACE_INVALID
) {
994 goto STR_TO_SB_REPLACE_INVALID
;
998 ret_val
= (size_t)-1;
1000 goto STR_TO_SB_ILLEGAL_CHAR_ERR
;
1003 } else if (*ib
< 0x80 || *ib
> 0xbf) {
1004 if (flag
& KICONV_REPLACE_INVALID
) {
1006 goto STR_TO_SB_REPLACE_INVALID
;
1010 ret_val
= (size_t)-1;
1012 goto STR_TO_SB_ILLEGAL_CHAR_ERR
;
1014 u8
= (u8
<< 8) | ((uint32_t)*ib
);
1022 if (tbl
[i
].u8
== u8
)
1024 else if (tbl
[i
].u8
< u8
)
1030 if (tbl
[i
].u8
== u8
) {
1033 STR_TO_SB_REPLACE_INVALID
:
1034 *ob
++ = KICONV_ASCII_REPLACEMENT_CHAR
;
1039 STR_TO_SB_ILLEGAL_CHAR_ERR
:
1040 *inlen
= ibtail
- ib
;
1041 *outlen
= obtail
- ob
;
1047 * The following 25 functions are the real entry points that will be
1048 * given to the kiconv framework at the genunix.
1051 kiconvstr_to_720(char *inarray
, size_t *inlen
, char *outarray
,
1052 size_t *outlen
, int flag
, int *errno
)
1054 return (kiconvstr_to_sb(KICONV_TBLID_720
, (uchar_t
*)inarray
,
1055 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1059 kiconvstr_to_737(char *inarray
, size_t *inlen
, char *outarray
,
1060 size_t *outlen
, int flag
, int *errno
)
1062 return (kiconvstr_to_sb(KICONV_TBLID_737
, (uchar_t
*)inarray
,
1063 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1067 kiconvstr_to_852(char *inarray
, size_t *inlen
, char *outarray
,
1068 size_t *outlen
, int flag
, int *errno
)
1070 return (kiconvstr_to_sb(KICONV_TBLID_852
, (uchar_t
*)inarray
,
1071 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1075 kiconvstr_to_857(char *inarray
, size_t *inlen
, char *outarray
,
1076 size_t *outlen
, int flag
, int *errno
)
1078 return (kiconvstr_to_sb(KICONV_TBLID_857
, (uchar_t
*)inarray
,
1079 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1083 kiconvstr_to_862(char *inarray
, size_t *inlen
, char *outarray
,
1084 size_t *outlen
, int flag
, int *errno
)
1086 return (kiconvstr_to_sb(KICONV_TBLID_862
, (uchar_t
*)inarray
,
1087 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1091 kiconvstr_to_866(char *inarray
, size_t *inlen
, char *outarray
,
1092 size_t *outlen
, int flag
, int *errno
)
1094 return (kiconvstr_to_sb(KICONV_TBLID_866
, (uchar_t
*)inarray
,
1095 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1099 kiconvstr_to_1250(char *inarray
, size_t *inlen
, char *outarray
,
1100 size_t *outlen
, int flag
, int *errno
)
1102 return (kiconvstr_to_sb(KICONV_TBLID_1250
, (uchar_t
*)inarray
,
1103 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1107 kiconvstr_to_1251(char *inarray
, size_t *inlen
, char *outarray
,
1108 size_t *outlen
, int flag
, int *errno
)
1110 return (kiconvstr_to_sb(KICONV_TBLID_1251
, (uchar_t
*)inarray
,
1111 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1115 kiconvstr_to_1253(char *inarray
, size_t *inlen
, char *outarray
,
1116 size_t *outlen
, int flag
, int *errno
)
1118 return (kiconvstr_to_sb(KICONV_TBLID_1253
, (uchar_t
*)inarray
,
1119 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1123 kiconvstr_to_1254(char *inarray
, size_t *inlen
, char *outarray
,
1124 size_t *outlen
, int flag
, int *errno
)
1126 return (kiconvstr_to_sb(KICONV_TBLID_1254
, (uchar_t
*)inarray
,
1127 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1131 kiconvstr_to_1255(char *inarray
, size_t *inlen
, char *outarray
,
1132 size_t *outlen
, int flag
, int *errno
)
1134 return (kiconvstr_to_sb(KICONV_TBLID_1255
, (uchar_t
*)inarray
,
1135 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1139 kiconvstr_to_1256(char *inarray
, size_t *inlen
, char *outarray
,
1140 size_t *outlen
, int flag
, int *errno
)
1142 return (kiconvstr_to_sb(KICONV_TBLID_1256
, (uchar_t
*)inarray
,
1143 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1147 kiconvstr_to_1257(char *inarray
, size_t *inlen
, char *outarray
,
1148 size_t *outlen
, int flag
, int *errno
)
1150 return (kiconvstr_to_sb(KICONV_TBLID_1257
, (uchar_t
*)inarray
,
1151 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1155 kiconvstr_to_88592(char *inarray
, size_t *inlen
, char *outarray
,
1156 size_t *outlen
, int flag
, int *errno
)
1158 return (kiconvstr_to_sb(KICONV_TBLID_8859_2
, (uchar_t
*)inarray
,
1159 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1163 kiconvstr_to_88593(char *inarray
, size_t *inlen
, char *outarray
,
1164 size_t *outlen
, int flag
, int *errno
)
1166 return (kiconvstr_to_sb(KICONV_TBLID_8859_3
, (uchar_t
*)inarray
,
1167 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1171 kiconvstr_to_88594(char *inarray
, size_t *inlen
, char *outarray
,
1172 size_t *outlen
, int flag
, int *errno
)
1174 return (kiconvstr_to_sb(KICONV_TBLID_8859_4
, (uchar_t
*)inarray
,
1175 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1179 kiconvstr_to_88595(char *inarray
, size_t *inlen
, char *outarray
,
1180 size_t *outlen
, int flag
, int *errno
)
1182 return (kiconvstr_to_sb(KICONV_TBLID_8859_5
, (uchar_t
*)inarray
,
1183 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1187 kiconvstr_to_88596(char *inarray
, size_t *inlen
, char *outarray
,
1188 size_t *outlen
, int flag
, int *errno
)
1190 return (kiconvstr_to_sb(KICONV_TBLID_8859_6
, (uchar_t
*)inarray
,
1191 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1195 kiconvstr_to_88597(char *inarray
, size_t *inlen
, char *outarray
,
1196 size_t *outlen
, int flag
, int *errno
)
1198 return (kiconvstr_to_sb(KICONV_TBLID_8859_7
, (uchar_t
*)inarray
,
1199 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1203 kiconvstr_to_88598(char *inarray
, size_t *inlen
, char *outarray
,
1204 size_t *outlen
, int flag
, int *errno
)
1206 return (kiconvstr_to_sb(KICONV_TBLID_8859_8
, (uchar_t
*)inarray
,
1207 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1211 kiconvstr_to_88599(char *inarray
, size_t *inlen
, char *outarray
,
1212 size_t *outlen
, int flag
, int *errno
)
1214 return (kiconvstr_to_sb(KICONV_TBLID_8859_9
, (uchar_t
*)inarray
,
1215 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1219 kiconvstr_to_885910(char *inarray
, size_t *inlen
, char *outarray
,
1220 size_t *outlen
, int flag
, int *errno
)
1222 return (kiconvstr_to_sb(KICONV_TBLID_8859_10
, (uchar_t
*)inarray
,
1223 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1227 kiconvstr_to_885911(char *inarray
, size_t *inlen
, char *outarray
,
1228 size_t *outlen
, int flag
, int *errno
)
1230 return (kiconvstr_to_sb(KICONV_TBLID_8859_11
, (uchar_t
*)inarray
,
1231 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1235 kiconvstr_to_885913(char *inarray
, size_t *inlen
, char *outarray
,
1236 size_t *outlen
, int flag
, int *errno
)
1238 return (kiconvstr_to_sb(KICONV_TBLID_8859_13
, (uchar_t
*)inarray
,
1239 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1243 kiconvstr_to_koi8r(char *inarray
, size_t *inlen
, char *outarray
,
1244 size_t *outlen
, int flag
, int *errno
)
1246 return (kiconvstr_to_sb(KICONV_TBLID_KOI8_R
, (uchar_t
*)inarray
,
1247 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1251 * The following is the common kiconvstr function for the conversions from
1252 * single byte codeset to UTF-8.
1255 kiconvstr_fr_sb(size_t id
, uchar_t
*ib
, size_t *inlen
, uchar_t
*ob
,
1256 size_t *outlen
, int flag
, int *errno
)
1258 kiconv_to_utf8_tbl_comp_t
*tbl
;
1265 boolean_t do_not_ignore_null
;
1267 if (id
> KICONV_MAX_MAPPING_TBLID
&&
1268 (id
< KICONV_TBLID_RANGE1_START
|| id
> KICONV_TBLID_RANGE1_END
)) {
1270 return ((size_t)-1);
1274 ibtail
= ib
+ *inlen
;
1275 obtail
= ob
+ *outlen
;
1276 do_not_ignore_null
= ((flag
& KICONV_IGNORE_NULL
) == 0);
1278 tbl
= (id
== KICONV_TBLID_720
) ?
1279 (kiconv_to_utf8_tbl_comp_t
*)cp720_to_u8_tbl
:
1280 (kiconv_to_utf8_tbl_comp_t
*)to_u8_tbl
[id
];
1282 while (ib
< ibtail
) {
1283 if (*ib
== '\0' && do_not_ignore_null
)
1289 ret_val
= (size_t)-1;
1297 sz
= u8_number_of_bytes
[tbl
[k
].u8
[0]];
1300 if (flag
& KICONV_REPLACE_INVALID
) {
1301 if ((obtail
- ob
) < 3) {
1303 ret_val
= (size_t)-1;
1307 /* Save KICONV_UTF8_REPLACEMENT_CHAR. */
1318 ret_val
= (size_t)-1;
1322 if ((obtail
- ob
) < sz
) {
1324 ret_val
= (size_t)-1;
1328 for (i
= 0; i
< sz
; i
++)
1329 *ob
++ = tbl
[k
].u8
[i
];
1334 *inlen
= ibtail
- ib
;
1335 *outlen
= obtail
- ob
;
1341 * The following 25 functions are the real entry points that will be
1342 * given to kiconv framework at the genunix.
1345 kiconvstr_fr_720(char *inarray
, size_t *inlen
, char *outarray
,
1346 size_t *outlen
, int flag
, int *errno
)
1348 return (kiconvstr_fr_sb(KICONV_TBLID_720
, (uchar_t
*)inarray
,
1349 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1353 kiconvstr_fr_737(char *inarray
, size_t *inlen
, char *outarray
,
1354 size_t *outlen
, int flag
, int *errno
)
1356 return (kiconvstr_fr_sb(KICONV_TBLID_737
, (uchar_t
*)inarray
,
1357 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1361 kiconvstr_fr_852(char *inarray
, size_t *inlen
, char *outarray
,
1362 size_t *outlen
, int flag
, int *errno
)
1364 return (kiconvstr_fr_sb(KICONV_TBLID_852
, (uchar_t
*)inarray
,
1365 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1369 kiconvstr_fr_857(char *inarray
, size_t *inlen
, char *outarray
,
1370 size_t *outlen
, int flag
, int *errno
)
1372 return (kiconvstr_fr_sb(KICONV_TBLID_857
, (uchar_t
*)inarray
,
1373 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1377 kiconvstr_fr_862(char *inarray
, size_t *inlen
, char *outarray
,
1378 size_t *outlen
, int flag
, int *errno
)
1380 return (kiconvstr_fr_sb(KICONV_TBLID_862
, (uchar_t
*)inarray
,
1381 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1385 kiconvstr_fr_866(char *inarray
, size_t *inlen
, char *outarray
,
1386 size_t *outlen
, int flag
, int *errno
)
1388 return (kiconvstr_fr_sb(KICONV_TBLID_866
, (uchar_t
*)inarray
,
1389 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1393 kiconvstr_fr_1250(char *inarray
, size_t *inlen
, char *outarray
,
1394 size_t *outlen
, int flag
, int *errno
)
1396 return (kiconvstr_fr_sb(KICONV_TBLID_1250
, (uchar_t
*)inarray
,
1397 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1401 kiconvstr_fr_1251(char *inarray
, size_t *inlen
, char *outarray
,
1402 size_t *outlen
, int flag
, int *errno
)
1404 return (kiconvstr_fr_sb(KICONV_TBLID_1251
, (uchar_t
*)inarray
,
1405 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1409 kiconvstr_fr_1253(char *inarray
, size_t *inlen
, char *outarray
,
1410 size_t *outlen
, int flag
, int *errno
)
1412 return (kiconvstr_fr_sb(KICONV_TBLID_1253
, (uchar_t
*)inarray
,
1413 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1417 kiconvstr_fr_1254(char *inarray
, size_t *inlen
, char *outarray
,
1418 size_t *outlen
, int flag
, int *errno
)
1420 return (kiconvstr_fr_sb(KICONV_TBLID_1254
, (uchar_t
*)inarray
,
1421 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1425 kiconvstr_fr_1255(char *inarray
, size_t *inlen
, char *outarray
,
1426 size_t *outlen
, int flag
, int *errno
)
1428 return (kiconvstr_fr_sb(KICONV_TBLID_1255
, (uchar_t
*)inarray
,
1429 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1433 kiconvstr_fr_1256(char *inarray
, size_t *inlen
, char *outarray
,
1434 size_t *outlen
, int flag
, int *errno
)
1436 return (kiconvstr_fr_sb(KICONV_TBLID_1256
, (uchar_t
*)inarray
,
1437 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1441 kiconvstr_fr_1257(char *inarray
, size_t *inlen
, char *outarray
,
1442 size_t *outlen
, int flag
, int *errno
)
1444 return (kiconvstr_fr_sb(KICONV_TBLID_1257
, (uchar_t
*)inarray
,
1445 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1449 kiconvstr_fr_88592(char *inarray
, size_t *inlen
, char *outarray
,
1450 size_t *outlen
, int flag
, int *errno
)
1452 return (kiconvstr_fr_sb(KICONV_TBLID_8859_2
, (uchar_t
*)inarray
,
1453 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1457 kiconvstr_fr_88593(char *inarray
, size_t *inlen
, char *outarray
,
1458 size_t *outlen
, int flag
, int *errno
)
1460 return (kiconvstr_fr_sb(KICONV_TBLID_8859_3
, (uchar_t
*)inarray
,
1461 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1465 kiconvstr_fr_88594(char *inarray
, size_t *inlen
, char *outarray
,
1466 size_t *outlen
, int flag
, int *errno
)
1468 return (kiconvstr_fr_sb(KICONV_TBLID_8859_4
, (uchar_t
*)inarray
,
1469 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1473 kiconvstr_fr_88595(char *inarray
, size_t *inlen
, char *outarray
,
1474 size_t *outlen
, int flag
, int *errno
)
1476 return (kiconvstr_fr_sb(KICONV_TBLID_8859_5
, (uchar_t
*)inarray
,
1477 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1481 kiconvstr_fr_88596(char *inarray
, size_t *inlen
, char *outarray
,
1482 size_t *outlen
, int flag
, int *errno
)
1484 return (kiconvstr_fr_sb(KICONV_TBLID_8859_6
, (uchar_t
*)inarray
,
1485 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1489 kiconvstr_fr_88597(char *inarray
, size_t *inlen
, char *outarray
,
1490 size_t *outlen
, int flag
, int *errno
)
1492 return (kiconvstr_fr_sb(KICONV_TBLID_8859_7
, (uchar_t
*)inarray
,
1493 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1497 kiconvstr_fr_88598(char *inarray
, size_t *inlen
, char *outarray
,
1498 size_t *outlen
, int flag
, int *errno
)
1500 return (kiconvstr_fr_sb(KICONV_TBLID_8859_8
, (uchar_t
*)inarray
,
1501 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1505 kiconvstr_fr_88599(char *inarray
, size_t *inlen
, char *outarray
,
1506 size_t *outlen
, int flag
, int *errno
)
1508 return (kiconvstr_fr_sb(KICONV_TBLID_8859_9
, (uchar_t
*)inarray
,
1509 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1513 kiconvstr_fr_885910(char *inarray
, size_t *inlen
, char *outarray
,
1514 size_t *outlen
, int flag
, int *errno
)
1516 return (kiconvstr_fr_sb(KICONV_TBLID_8859_10
, (uchar_t
*)inarray
,
1517 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1521 kiconvstr_fr_885911(char *inarray
, size_t *inlen
, char *outarray
,
1522 size_t *outlen
, int flag
, int *errno
)
1524 return (kiconvstr_fr_sb(KICONV_TBLID_8859_11
, (uchar_t
*)inarray
,
1525 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1529 kiconvstr_fr_885913(char *inarray
, size_t *inlen
, char *outarray
,
1530 size_t *outlen
, int flag
, int *errno
)
1532 return (kiconvstr_fr_sb(KICONV_TBLID_8859_13
, (uchar_t
*)inarray
,
1533 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1537 kiconvstr_fr_koi8r(char *inarray
, size_t *inlen
, char *outarray
,
1538 size_t *outlen
, int flag
, int *errno
)
1540 return (kiconvstr_fr_sb(KICONV_TBLID_KOI8_R
, (uchar_t
*)inarray
,
1541 inlen
, (uchar_t
*)outarray
, outlen
, flag
, errno
));
1546 * The following are the supported code conversions that will be passed to
1547 * and registered from this module. The tocode and fromcode names are
1550 #define KICONV_MAX_EMEA_OPS 50
1552 static kiconv_ops_t kiconv_emea_ops
[KICONV_MAX_EMEA_OPS
] = {
1555 open_fr_1250
, kiconv_fr_sb
, close_fr_sb
, kiconvstr_fr_1250
1559 open_to_1250
, kiconv_to_sb
, close_to_sb
, kiconvstr_to_1250
1563 open_fr_88592
, kiconv_fr_sb
, close_fr_sb
, kiconvstr_fr_88592
1567 open_to_88592
, kiconv_to_sb
, close_to_sb
, kiconvstr_to_88592
1571 open_fr_852
, kiconv_fr_sb
, close_fr_sb
, kiconvstr_fr_852
1575 open_to_852
, kiconv_to_sb
, close_to_sb
, kiconvstr_to_852
1579 open_fr_1251
, kiconv_fr_sb
, close_fr_sb
, kiconvstr_fr_1251
1583 open_to_1251
, kiconv_to_sb
, close_to_sb
, kiconvstr_to_1251
1587 open_fr_88595
, kiconv_fr_sb
, close_fr_sb
, kiconvstr_fr_88595
1591 open_to_88595
, kiconv_to_sb
, close_to_sb
, kiconvstr_to_88595
1595 open_fr_koi8r
, kiconv_fr_sb
, close_fr_sb
, kiconvstr_fr_koi8r
1599 open_to_koi8r
, kiconv_to_sb
, close_to_sb
, kiconvstr_to_koi8r
1603 open_fr_866
, kiconv_fr_sb
, close_fr_sb
, kiconvstr_fr_866
1607 open_to_866
, kiconv_to_sb
, close_to_sb
, kiconvstr_to_866
1611 open_fr_1253
, kiconv_fr_sb
, close_fr_sb
, kiconvstr_fr_1253
1615 open_to_1253
, kiconv_to_sb
, close_to_sb
, kiconvstr_to_1253
1619 open_fr_88597
, kiconv_fr_sb
, close_fr_sb
, kiconvstr_fr_88597
1623 open_to_88597
, kiconv_to_sb
, close_to_sb
, kiconvstr_to_88597
1627 open_fr_737
, kiconv_fr_sb
, close_fr_sb
, kiconvstr_fr_737
1631 open_to_737
, kiconv_to_sb
, close_to_sb
, kiconvstr_to_737
1635 open_fr_1254
, kiconv_fr_sb
, close_fr_sb
, kiconvstr_fr_1254
1639 open_to_1254
, kiconv_to_sb
, close_to_sb
, kiconvstr_to_1254
1643 open_fr_88599
, kiconv_fr_sb
, close_fr_sb
, kiconvstr_fr_88599
1647 open_to_88599
, kiconv_to_sb
, close_to_sb
, kiconvstr_to_88599
1651 open_fr_857
, kiconv_fr_sb
, close_fr_sb
, kiconvstr_fr_857
1655 open_to_857
, kiconv_to_sb
, close_to_sb
, kiconvstr_to_857
1659 open_fr_1256
, kiconv_fr_sb
, close_fr_sb
, kiconvstr_fr_1256
1663 open_to_1256
, kiconv_to_sb
, close_to_sb
, kiconvstr_to_1256
1667 open_fr_88596
, kiconv_fr_sb
, close_fr_sb
, kiconvstr_fr_88596
1671 open_to_88596
, kiconv_to_sb
, close_to_sb
, kiconvstr_to_88596
1675 open_fr_720
, kiconv_fr_sb
, close_fr_sb
, kiconvstr_fr_720
1679 open_to_720
, kiconv_to_sb
, close_to_sb
, kiconvstr_to_720
1683 open_fr_1255
, kiconv_fr_sb
, close_fr_sb
, kiconvstr_fr_1255
1687 open_to_1255
, kiconv_to_sb
, close_to_sb
, kiconvstr_to_1255
1691 open_fr_88598
, kiconv_fr_sb
, close_fr_sb
, kiconvstr_fr_88598
1695 open_to_88598
, kiconv_to_sb
, close_to_sb
, kiconvstr_to_88598
1699 open_fr_862
, kiconv_fr_sb
, close_fr_sb
, kiconvstr_fr_862
1703 open_to_862
, kiconv_to_sb
, close_to_sb
, kiconvstr_to_862
1707 open_fr_1257
, kiconv_fr_sb
, close_fr_sb
, kiconvstr_fr_1257
1711 open_to_1257
, kiconv_to_sb
, close_to_sb
, kiconvstr_to_1257
1714 "utf8", "iso885913",
1715 open_fr_885913
, kiconv_fr_sb
, close_fr_sb
, kiconvstr_fr_885913
1718 "iso885913", "utf8",
1719 open_to_885913
, kiconv_to_sb
, close_to_sb
, kiconvstr_to_885913
1722 "utf8", "iso885910",
1723 open_fr_885910
, kiconv_fr_sb
, close_fr_sb
, kiconvstr_fr_885910
1726 "iso885910", "utf8",
1727 open_to_885910
, kiconv_to_sb
, close_to_sb
, kiconvstr_to_885910
1730 "utf8", "iso885911",
1731 open_fr_885911
, kiconv_fr_sb
, close_fr_sb
, kiconvstr_fr_885911
1734 "iso885911", "utf8",
1735 open_to_885911
, kiconv_to_sb
, close_to_sb
, kiconvstr_to_885911
1739 open_fr_88593
, kiconv_fr_sb
, close_fr_sb
, kiconvstr_fr_88593
1743 open_to_88593
, kiconv_to_sb
, close_to_sb
, kiconvstr_to_88593
1747 open_fr_88594
, kiconv_fr_sb
, close_fr_sb
, kiconvstr_fr_88594
1751 open_to_88594
, kiconv_to_sb
, close_to_sb
, kiconvstr_to_88594
1755 static kiconv_module_info_t kiconv_emea_modinfo
= {
1756 "kiconv_emea", /* Must be the same as in kiconv framework. */
1757 KICONV_MAX_EMEA_OPS
, /* size_t kiconv_num_convs */
1758 kiconv_emea_ops
, /* kiconv_ops_t *kiconv_ops_tbl */
1759 0, /* size_t kiconv_num_aliases */
1760 NULL
, /* char **aliases */
1761 NULL
, /* char **canonicals */
1765 static struct modlkiconv kiconv_emea
= {
1767 "kiconv module for EMEA",
1768 &kiconv_emea_modinfo
1771 static struct modlinkage linkage
= {
1773 (void *)&kiconv_emea
,
1782 err
= mod_install(&linkage
);
1784 cmn_err(CE_WARN
, "kiconv_emea: failed to load kernel module");
1790 _info(struct modinfo
*modinfop
)
1792 return (mod_info(&linkage
, modinfop
));
1801 * If this module is being used, then, we cannot remove the module.
1802 * The following checking will catch pretty much all usual cases.
1804 * Any remaining will be catached by the kiconv_unregister_module()
1805 * during mod_remove() at below.
1807 if (kiconv_module_ref_count(KICONV_MODULE_ID_EMEA
))
1810 err
= mod_remove(&linkage
);
1812 cmn_err(CE_WARN
, "kiconv_emea: failed to remove kernel module");