d14d7d31f2a70b1e0a9c933607d6627f5718980eis * CDDL HEADER START
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * The contents of this file are subject to the terms of the
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * Common Development and Distribution License (the "License").
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * You may not use this file except in compliance with the License.
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * See the License for the specific language governing permissions
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * and limitations under the License.
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * When distributing Covered Code, include this CDDL HEADER in each
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * If applicable, add the following below this CDDL HEADER, with the
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * fields enclosed by brackets "[]" replaced with your own identifying
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * information: Portions Copyright [yyyy] [name of copyright owner]
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * CDDL HEADER END
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * Use is subject to license terms.
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * COPYRIGHT AND PERMISSION NOTICE
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * Copyright (c) 1991-2006 Unicode, Inc. All rights reserved. Distributed under
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * the Terms of Use in http://www.unicode.org/copyright.html.
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * Permission is hereby granted, free of charge, to any person obtaining
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * a copy of the Unicode data files and any associated documentation (the
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * "Data Files") or Unicode software and any associated documentation (the
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * "Software") to deal in the Data Files or Software without restriction,
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * including without limitation the rights to use, copy, modify, merge,
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * publish, distribute, and/or sell copies of the Data Files or Software, and
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * to permit persons to whom the Data Files or Software are furnished to do so,
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * provided that (a) the above copyright notice(s) and this permission notice
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * appear with all copies of the Data Files or Software, (b) both the above
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * copyright notice(s) and this permission notice appear in associated
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * documentation, and (c) there is clear notice in each modified Data File or
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * in the Software as well as in the documentation associated with the Data
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * File(s) or Software that the data or software has been modified.
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * OF THE DATA FILES OR SOFTWARE.
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * Except as contained in this notice, the name of a copyright holder shall not
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * be used in advertising or otherwise to promote the sale, use or other
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * dealings in these Data Files or Software without prior written authorization
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * of the copyright holder.
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * Unicode and the Unicode logo are trademarks of Unicode, Inc., and may be
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * registered in some jurisdictions. All other trademarks and registered
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * trademarks mentioned herein are the property of their respective owners.
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * This file has been modified by Sun Microsystems, Inc.
d14d7d31f2a70b1e0a9c933607d6627f5718980eis#pragma ident "%Z%%M% %I% %E% SMI"
d14d7d31f2a70b1e0a9c933607d6627f5718980eisextern "C" {
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * Mapping tables from CP1252, ISO 8859-1, ISO 8859-15, and CP850 to UTF-8.
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * Indices are calculated by subtracting 0x80 from single byte character code
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * Each component has up to three UTF-8 character bytes; the first byte will
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * be used to figure out on how many bytes should be taken. If size figured
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * out has a value less than zero, that means that component isn't valid and
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * has no assigned character.
d14d7d31f2a70b1e0a9c933607d6627f5718980eisstatic const kiconv_to_utf8_tbl_comp_t to_u8_tbl[4][128] = {
d14d7d31f2a70b1e0a9c933607d6627f5718980eis { /* CP1252 -> UTF-8 */
d14d7d31f2a70b1e0a9c933607d6627f5718980eis { /* ISO 8859-1 -> UTF-8 */
d14d7d31f2a70b1e0a9c933607d6627f5718980eis { /* ISO 8859-15 -> UTF-8 */
d14d7d31f2a70b1e0a9c933607d6627f5718980eis { /* CP850 -> UTF-8 */
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * Mapping tables from UTF-8 to CP1252, ISO 8859-1, ISO 8859-15, and CP850.
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * Each table is sorted with UTF-8 values to be used with binary search.
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * UTF-8 character byte values are saved at uint32_t:24 contiguously as
d14d7d31f2a70b1e0a9c933607d6627f5718980eis * scalar values.
d14d7d31f2a70b1e0a9c933607d6627f5718980eisstatic const kiconv_to_sb_tbl_comp_t to_sb_tbl[4][128] = {
d14d7d31f2a70b1e0a9c933607d6627f5718980eis { /* UTF-8 -> CP1252 */
d14d7d31f2a70b1e0a9c933607d6627f5718980eis { /* UTF-8 -> ISO 8859-1 */
d14d7d31f2a70b1e0a9c933607d6627f5718980eis { /* UTF-8 -> ISO 8859-15 */
d14d7d31f2a70b1e0a9c933607d6627f5718980eis { /* UTF-8 -> CP850 */
d14d7d31f2a70b1e0a9c933607d6627f5718980eis#endif /* _KERNEL */
d14d7d31f2a70b1e0a9c933607d6627f5718980eis#endif /* _SYS_KICONV_LATIN1_H */