mirror of https://github.com/postgres/postgres
up a bunch of the support utilities. In src/backend/utils/mb/Unicode remove nearly duplicate copies of the UCS_to_XXX perl script and replace with one version to handle all generic files. Update the Makefile so that it knows about all the map files. This produces a slight difference in some of the map files, using a uniform naming convention and not mapping the null character. In src/backend/utils/mb/conversion_procs create a master utf8<->win codepage function like the ISO 8859 versions instead of having a separate handler for each conversion. There is an externally visible change in the name of the win1258 to utf8 conversion. According to the documentation notes, it was named incorrectly and this changes it to a standard name. Running the Unicode mapping perl scripts has shown some additional mapping changes in koi8r and iso8859-7.REL8_2_STABLE
parent
a6d3b5b944
commit
1b658473ea
@ -1,15 +1,11 @@ |
||||
common.c: public functions for both the backend and the frontend. |
||||
requires conv.c and wchar.c |
||||
encnames.c: public functions for both the backend and the frontend. |
||||
conv.c: static functions and a public table for code conversion |
||||
wchar.c: mostly static functions and a public table for mb string and |
||||
multibyte conversion |
||||
mbutilc.c: public functions for the backend only. |
||||
mbutils.c: public functions for the backend only. |
||||
requires conv.c and wchar.c |
||||
wstrcmp.c: strcmp for mb |
||||
wstrncmp.c: strncmp for mb |
||||
alt.c: a tool to generate KOI8 <--> CP866 conversion table |
||||
win866.c: a tool to generate KOI8 <--> CP866 conversion table |
||||
iso.c: a tool to generate KOI8 <--> ISO8859-5 conversion table |
||||
win.c: a tool to generate KOI8 <--> CP1251 conversion table |
||||
big5.c: conversion between BIG5 and Mule Internal Code(CNS 116643-1992 |
||||
plane 1 and plane 2). |
||||
utftest.c: test driver for utf2wchar() |
||||
win1251.c: a tool to generate KOI8 <--> CP1251 conversion table |
||||
|
@ -1,110 +0,0 @@ |
||||
#! /usr/bin/perl |
||||
# |
||||
# Copyright (c) 2001-2005, PostgreSQL Global Development Group |
||||
# |
||||
# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_8859.pl,v 1.8 2005/03/07 04:30:52 momjian Exp $ |
||||
# |
||||
# Generate UTF-8 <--> ISO8859 code conversion tables from |
||||
# map files provided by Unicode organization. |
||||
# Unfortunately it is prohibited by the organization |
||||
# to distribute the map files. So if you try to use this script, |
||||
# you have to obtain "8859-[2-16].TXT" from the organization's ftp site. |
||||
# We assume the file include three tab-separated columns: |
||||
# ISO/IEC 8859 code in hex |
||||
# UCS-2 code in hex |
||||
# # and Unicode name (not used in this script) |
||||
|
||||
require "ucs2utf.pl"; |
||||
|
||||
@charsets = (2,3,4,5,6,7,8,9,10,13,14,15,16); |
||||
foreach $charset (@charsets) { |
||||
|
||||
# |
||||
# first, generate UTF8->ISO8859 table |
||||
# |
||||
$in_file = "8859-${charset}.TXT"; |
||||
|
||||
open( FILE, $in_file ) || die( "cannot open $in_file" ); |
||||
|
||||
reset 'array'; |
||||
|
||||
while( <FILE> ){ |
||||
chop; |
||||
if( /^#/ ){ |
||||
next; |
||||
} |
||||
( $c, $u, $rest ) = split; |
||||
$ucs = hex($u); |
||||
$code = hex($c); |
||||
if( $code >= 0x80){ |
||||
$utf = &ucs2utf($ucs); |
||||
if( $array{ $utf } ne "" ){ |
||||
printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; |
||||
next; |
||||
} |
||||
$count++; |
||||
$array{ $utf } = $code; |
||||
} |
||||
} |
||||
close( FILE ); |
||||
|
||||
$file = "utf8_to_iso8859_${charset}.map"; |
||||
open( FILE, "> $file" ) || die( "cannot open $file" ); |
||||
print FILE "static pg_utf_to_local ULmapISO8859_${charset}[ $count ] = {\n"; |
||||
|
||||
for $index ( sort {$a <=> $b} keys( %array ) ){ |
||||
$code = $array{ $index }; |
||||
$count--; |
||||
if( $count == 0 ){ |
||||
printf FILE " {0x%04x, 0x%04x}\n", $index, $code; |
||||
} else { |
||||
printf FILE " {0x%04x, 0x%04x},\n", $index, $code; |
||||
} |
||||
} |
||||
|
||||
print FILE "};\n"; |
||||
close(FILE); |
||||
|
||||
# |
||||
# then generate ISO885->UTF8 table |
||||
# |
||||
open( FILE, $in_file ) || die( "cannot open $in_file" ); |
||||
|
||||
reset 'array'; |
||||
|
||||
while( <FILE> ){ |
||||
chop; |
||||
if( /^#/ ){ |
||||
next; |
||||
} |
||||
( $c, $u, $rest ) = split; |
||||
$ucs = hex($u); |
||||
$code = hex($c); |
||||
if($code >= 0x80){ |
||||
$utf = &ucs2utf($ucs); |
||||
if( $array{ $utf } ne "" ){ |
||||
printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; |
||||
next; |
||||
} |
||||
$count++; |
||||
$array{ $code } = $utf; |
||||
} |
||||
} |
||||
close( FILE ); |
||||
|
||||
$file = "iso8859_${charset}_to_utf8.map"; |
||||
open( FILE, "> $file" ) || die( "cannot open $file" ); |
||||
print FILE "static pg_local_to_utf LUmapISO8859_${charset}[ $count ] = {\n"; |
||||
for $index ( sort {$a <=> $b} keys( %array ) ){ |
||||
$utf = $array{ $index }; |
||||
$count--; |
||||
if( $count == 0 ){ |
||||
printf FILE " {0x%04x, 0x%04x}\n", $index, $utf; |
||||
} else { |
||||
printf FILE " {0x%04x, 0x%04x},\n", $index, $utf; |
||||
} |
||||
} |
||||
|
||||
print FILE "};\n"; |
||||
close(FILE); |
||||
} |
@ -1,111 +0,0 @@ |
||||
#! /usr/bin/perl |
||||
# |
||||
# Copyright (c) 2001-2005, PostgreSQL Global Development Group |
||||
# |
||||
# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_BIG5.pl,v 1.7 2005/03/07 04:30:52 momjian Exp $ |
||||
# |
||||
# Generate UTF-8 <--> BIG5 code conversion tables from |
||||
# map files provided by Unicode organization. |
||||
# Unfortunately it is prohibited by the organization |
||||
# to distribute the map files. So if you try to use this script, |
||||
# you have to obtain OLD5601.TXT from |
||||
# the organization's ftp site. |
||||
# |
||||
# OLD5601.TXT format: |
||||
# KSC5601 code in hex |
||||
# UCS-2 code in hex |
||||
# # and Unicode name (not used in this script) |
||||
|
||||
require "ucs2utf.pl"; |
||||
|
||||
# first generate UTF-8 --> BIG5 table |
||||
|
||||
$in_file = "BIG5.TXT"; |
||||
|
||||
open( FILE, $in_file ) || die( "cannot open $in_file" ); |
||||
|
||||
while( <FILE> ){ |
||||
chop; |
||||
if( /^#/ ){ |
||||
next; |
||||
} |
||||
( $c, $u, $rest ) = split; |
||||
$ucs = hex($u); |
||||
$code = hex($c); |
||||
if( $code >= 0x80 && $ucs >= 0x0080 ){ |
||||
$utf = &ucs2utf($ucs); |
||||
if( $array{ $utf } ne "" ){ |
||||
printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; |
||||
next; |
||||
} |
||||
$count++; |
||||
|
||||
$array{ $utf } = $code; |
||||
} |
||||
} |
||||
close( FILE ); |
||||
|
||||
# |
||||
# first, generate UTF8 --> BIG5 table |
||||
# |
||||
|
||||
$file = "utf8_to_big5.map"; |
||||
open( FILE, "> $file" ) || die( "cannot open $file" ); |
||||
print FILE "static pg_utf_to_local ULmapBIG5[ $count ] = {\n"; |
||||
|
||||
for $index ( sort {$a <=> $b} keys( %array ) ){ |
||||
$code = $array{ $index }; |
||||
$count--; |
||||
if( $count == 0 ){ |
||||
printf FILE " {0x%04x, 0x%04x}\n", $index, $code; |
||||
} else { |
||||
printf FILE " {0x%04x, 0x%04x},\n", $index, $code; |
||||
} |
||||
} |
||||
|
||||
print FILE "};\n"; |
||||
close(FILE); |
||||
|
||||
# |
||||
# then generate EUC_JP --> UTF8 table |
||||
# |
||||
reset 'array'; |
||||
|
||||
open( FILE, $in_file ) || die( "cannot open $in_file" ); |
||||
|
||||
while( <FILE> ){ |
||||
chop; |
||||
if( /^#/ ){ |
||||
next; |
||||
} |
||||
( $c, $u, $rest ) = split; |
||||
$ucs = hex($u); |
||||
$code = hex($c); |
||||
if( $code >= 0x80 && $ucs >= 0x0080 ){ |
||||
$utf = &ucs2utf($ucs); |
||||
if( $array{ $code } ne "" ){ |
||||
printf STDERR "Warning: duplicate code: %04x\n",$ucs; |
||||
next; |
||||
} |
||||
$count++; |
||||
|
||||
$array{ $code } = $utf; |
||||
} |
||||
} |
||||
close( FILE ); |
||||
|
||||
$file = "big5_to_utf8.map"; |
||||
open( FILE, "> $file" ) || die( "cannot open $file" ); |
||||
print FILE "static pg_local_to_utf LUmapBIG5[ $count ] = {\n"; |
||||
for $index ( sort {$a <=> $b} keys( %array ) ){ |
||||
$utf = $array{ $index }; |
||||
$count--; |
||||
if( $count == 0 ){ |
||||
printf FILE " {0x%04x, 0x%04x}\n", $index, $utf; |
||||
} else { |
||||
printf FILE " {0x%04x, 0x%04x},\n", $index, $utf; |
||||
} |
||||
} |
||||
|
||||
print FILE "};\n"; |
||||
close(FILE); |
@ -1,112 +0,0 @@ |
||||
#! /usr/bin/perl |
||||
# |
||||
# Copyright (c) 2001-2005, PostgreSQL Global Development Group |
||||
# |
||||
# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_GBK.pl,v 1.6 2005/03/07 04:30:52 momjian Exp $ |
||||
# |
||||
# |
||||
# Generate UTF-8 <--> GBK code conversion tables from |
||||
# map files provided by Unicode organization. |
||||
# Unfortunately it is prohibited by the organization |
||||
# to distribute the map files. So if you try to use this script, |
||||
# you have to obtain CP936.TXT from |
||||
# the organization's ftp site. |
||||
# |
||||
# CP936.TXT format: |
||||
# GBK code in hex |
||||
# UCS-2 code in hex |
||||
# # and Unicode name (not used in this script) |
||||
|
||||
require "ucs2utf.pl"; |
||||
|
||||
# first generate UTF-8 --> GBK table |
||||
|
||||
$in_file = "CP936.TXT"; |
||||
|
||||
open( FILE, $in_file ) || die( "cannot open $in_file" ); |
||||
|
||||
while( <FILE> ){ |
||||
chop; |
||||
if( /^#/ ){ |
||||
next; |
||||
} |
||||
( $c, $u, $rest ) = split; |
||||
$ucs = hex($u); |
||||
$code = hex($c); |
||||
if( $code >= 0x80 && $ucs >= 0x0080 ){ |
||||
$utf = &ucs2utf($ucs); |
||||
if( $array{ $utf } ne "" ){ |
||||
printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; |
||||
next; |
||||
} |
||||
$count++; |
||||
|
||||
$array{ $utf } = $code; |
||||
} |
||||
} |
||||
close( FILE ); |
||||
|
||||
# |
||||
# first, generate UTF8 --> WIN949 table |
||||
# |
||||
|
||||
$file = "utf8_to_gbk.map"; |
||||
open( FILE, "> $file" ) || die( "cannot open $file" ); |
||||
print FILE "static pg_utf_to_local ULmapGBK[ $count ] = {\n"; |
||||
|
||||
for $index ( sort {$a <=> $b} keys( %array ) ){ |
||||
$code = $array{ $index }; |
||||
$count--; |
||||
if( $count == 0 ){ |
||||
printf FILE " {0x%04x, 0x%04x}\n", $index, $code; |
||||
} else { |
||||
printf FILE " {0x%04x, 0x%04x},\n", $index, $code; |
||||
} |
||||
} |
||||
|
||||
print FILE "};\n"; |
||||
close(FILE); |
||||
|
||||
# |
||||
# then generate WIN936 --> UTF8 table |
||||
# |
||||
reset 'array'; |
||||
|
||||
open( FILE, $in_file ) || die( "cannot open $in_file" ); |
||||
|
||||
while( <FILE> ){ |
||||
chop; |
||||
if( /^#/ ){ |
||||
next; |
||||
} |
||||
( $c, $u, $rest ) = split; |
||||
$ucs = hex($u); |
||||
$code = hex($c); |
||||
if( $code >= 0x80 && $ucs >= 0x0080 ){ |
||||
$utf = &ucs2utf($ucs); |
||||
if( $array{ $code } ne "" ){ |
||||
printf STDERR "Warning: duplicate code: %04x\n",$ucs; |
||||
next; |
||||
} |
||||
$count++; |
||||
|
||||
$array{ $code } = $utf; |
||||
} |
||||
} |
||||
close( FILE ); |
||||
|
||||
$file = "gbk_to_utf8.map"; |
||||
open( FILE, "> $file" ) || die( "cannot open $file" ); |
||||
print FILE "static pg_local_to_utf LUmapGBK[ $count ] = {\n"; |
||||
for $index ( sort {$a <=> $b} keys( %array ) ){ |
||||
$utf = $array{ $index }; |
||||
$count--; |
||||
if( $count == 0 ){ |
||||
printf FILE " {0x%04x, 0x%04x}\n", $index, $utf; |
||||
} else { |
||||
printf FILE " {0x%04x, 0x%04x},\n", $index, $utf; |
||||
} |
||||
} |
||||
|
||||
print FILE "};\n"; |
||||
close(FILE); |
@ -1,111 +0,0 @@ |
||||
#! /usr/bin/perl |
||||
# |
||||
# Copyright (c) 2001-2005, PostgreSQL Global Development Group |
||||
# |
||||
# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_JOHAB.pl,v 1.6 2005/03/07 04:30:52 momjian Exp $ |
||||
# |
||||
# Generate UTF-8 <--> JOHAB code conversion tables from |
||||
# map files provided by Unicode organization. |
||||
# Unfortunately it is prohibited by the organization |
||||
# to distribute the map files. So if you try to use this script, |
||||
# you have to obtain JOHAB.TXT from |
||||
# the organization's ftp site. |
||||
# |
||||
# JOHAB.TXT format: |
||||
# JOHAB code in hex |
||||
# UCS-2 code in hex |
||||
# # and Unicode name (not used in this script) |
||||
|
||||
require "ucs2utf.pl"; |
||||
|
||||
# first generate UTF-8 --> JOHAB table |
||||
|
||||
$in_file = "JOHAB.TXT"; |
||||
|
||||
open( FILE, $in_file ) || die( "cannot open $in_file" ); |
||||
|
||||
while( <FILE> ){ |
||||
chop; |
||||
if( /^#/ ){ |
||||
next; |
||||
} |
||||
( $c, $u, $rest ) = split; |
||||
$ucs = hex($u); |
||||
$code = hex($c); |
||||
if( $code >= 0x80 && $ucs >= 0x0080 ){ |
||||
$utf = &ucs2utf($ucs); |
||||
if( $array{ $utf } ne "" ){ |
||||
printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; |
||||
next; |
||||
} |
||||
$count++; |
||||
|
||||
$array{ $utf } = $code; |
||||
} |
||||
} |
||||
close( FILE ); |
||||
|
||||
# |
||||
# first, generate UTF8 --> JOHAB table |
||||
# |
||||
|
||||
$file = "utf8_to_johab.map"; |
||||
open( FILE, "> $file" ) || die( "cannot open $file" ); |
||||
print FILE "static pg_utf_to_local ULmapJOHAB[ $count ] = {\n"; |
||||
|
||||
for $index ( sort {$a <=> $b} keys( %array ) ){ |
||||
$code = $array{ $index }; |
||||
$count--; |
||||
if( $count == 0 ){ |
||||
printf FILE " {0x%04x, 0x%04x}\n", $index, $code; |
||||
} else { |
||||
printf FILE " {0x%04x, 0x%04x},\n", $index, $code; |
||||
} |
||||
} |
||||
|
||||
print FILE "};\n"; |
||||
close(FILE); |
||||
|
||||
# |
||||
# then generate JOHAB --> UTF8 table |
||||
# |
||||
reset 'array'; |
||||
|
||||
open( FILE, $in_file ) || die( "cannot open $in_file" ); |
||||
|
||||
while( <FILE> ){ |
||||
chop; |
||||
if( /^#/ ){ |
||||
next; |
||||
} |
||||
( $c, $u, $rest ) = split; |
||||
$ucs = hex($u); |
||||
$code = hex($c); |
||||
if( $code >= 0x80 && $ucs >= 0x0080 ){ |
||||
$utf = &ucs2utf($ucs); |
||||
if( $array{ $code } ne "" ){ |
||||
printf STDERR "Warning: duplicate code: %04x\n",$ucs; |
||||
next; |
||||
} |
||||
$count++; |
||||
|
||||
$array{ $code } = $utf; |
||||
} |
||||
} |
||||
close( FILE ); |
||||
|
||||
$file = "johab_to_utf8.map"; |
||||
open( FILE, "> $file" ) || die( "cannot open $file" ); |
||||
print FILE "static pg_local_to_utf LUmapJOHAB[ $count ] = {\n"; |
||||
for $index ( sort {$a <=> $b} keys( %array ) ){ |
||||
$utf = $array{ $index }; |
||||
$count--; |
||||
if( $count == 0 ){ |
||||
printf FILE " {0x%04x, 0x%04x}\n", $index, $utf; |
||||
} else { |
||||
printf FILE " {0x%04x, 0x%04x},\n", $index, $utf; |
||||
} |
||||
} |
||||
|
||||
print FILE "};\n"; |
||||
close(FILE); |
@ -1,111 +0,0 @@ |
||||
#! /usr/bin/perl |
||||
# |
||||
# Copyright (c) 2001-2005, PostgreSQL Global Development Group |
||||
# |
||||
# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_UHC.pl,v 1.6 2005/03/07 04:30:52 momjian Exp $ |
||||
# |
||||
# Generate UTF-8 <--> BIG5 code conversion tables from |
||||
# map files provided by Unicode organization. |
||||
# Unfortunately it is prohibited by the organization |
||||
# to distribute the map files. So if you try to use this script, |
||||
# you have to obtain OLD5601.TXT from |
||||
# the organization's ftp site. |
||||
# |
||||
# CP949.TXT format: |
||||
# UHC code in hex |
||||
# UCS-2 code in hex |
||||
# # and Unicode name (not used in this script) |
||||
|
||||
require "ucs2utf.pl"; |
||||
|
||||
# first generate UTF-8 --> WIN949 table |
||||
|
||||
$in_file = "CP949.TXT"; |
||||
|
||||
open( FILE, $in_file ) || die( "cannot open $in_file" ); |
||||
|
||||
while( <FILE> ){ |
||||
chop; |
||||
if( /^#/ ){ |
||||
next; |
||||
} |
||||
( $c, $u, $rest ) = split; |
||||
$ucs = hex($u); |
||||
$code = hex($c); |
||||
if( $code >= 0x80 && $ucs >= 0x0080 ){ |
||||
$utf = &ucs2utf($ucs); |
||||
if( $array{ $utf } ne "" ){ |
||||
printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; |
||||
next; |
||||
} |
||||
$count++; |
||||
|
||||
$array{ $utf } = $code; |
||||
} |
||||
} |
||||
close( FILE ); |
||||
|
||||
# |
||||
# first, generate UTF8 --> UHC table |
||||
# |
||||
|
||||
$file = "utf8_to_uhc.map"; |
||||
open( FILE, "> $file" ) || die( "cannot open $file" ); |
||||
print FILE "static pg_utf_to_local ULmapUHC[ $count ] = {\n"; |
||||
|
||||
for $index ( sort {$a <=> $b} keys( %array ) ){ |
||||
$code = $array{ $index }; |
||||
$count--; |
||||
if( $count == 0 ){ |
||||
printf FILE " {0x%04x, 0x%04x}\n", $index, $code; |
||||
} else { |
||||
printf FILE " {0x%04x, 0x%04x},\n", $index, $code; |
||||
} |
||||
} |
||||
|
||||
print FILE "};\n"; |
||||
close(FILE); |
||||
|
||||
# |
||||
# then generate UHC --> UTF8 table |
||||
# |
||||
reset 'array'; |
||||
|
||||
open( FILE, $in_file ) || die( "cannot open $in_file" ); |
||||
|
||||
while( <FILE> ){ |
||||
chop; |
||||
if( /^#/ ){ |
||||
next; |
||||
} |
||||
( $c, $u, $rest ) = split; |
||||
$ucs = hex($u); |
||||
$code = hex($c); |
||||
if( $code >= 0x80 && $ucs >= 0x0080 ){ |
||||
$utf = &ucs2utf($ucs); |
||||
if( $array{ $code } ne "" ){ |
||||
printf STDERR "Warning: duplicate code: %04x\n",$ucs; |
||||
next; |
||||
} |
||||
$count++; |
||||
|
||||
$array{ $code } = $utf; |
||||
} |
||||
} |
||||
close( FILE ); |
||||
|
||||
$file = "uhc_to_utf8.map"; |
||||
open( FILE, "> $file" ) || die( "cannot open $file" ); |
||||
print FILE "static pg_local_to_utf LUmapUHC[ $count ] = {\n"; |
||||
for $index ( sort {$a <=> $b} keys( %array ) ){ |
||||
$utf = $array{ $index }; |
||||
$count--; |
||||
if( $count == 0 ){ |
||||
printf FILE " {0x%04x, 0x%04x}\n", $index, $utf; |
||||
} else { |
||||
printf FILE " {0x%04x, 0x%04x},\n", $index, $utf; |
||||
} |
||||
} |
||||
|
||||
print FILE "};\n"; |
||||
close(FILE); |
@ -1,111 +0,0 @@ |
||||
#! /usr/bin/perl |
||||
# |
||||
# Copyright (c) 2001-2005, PostgreSQL Global Development Group |
||||
# |
||||
# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_WIN874.pl,v 1.6 2005/03/07 04:30:52 momjian Exp $ |
||||
# |
||||
# Generate UTF-8 <--> WIN874 code conversion tables from |
||||
# map files provided by Unicode organization. |
||||
# Unfortunately it is prohibited by the organization |
||||
# to distribute the map files. So if you try to use this script, |
||||
# you have to obtain OLD5601.TXT from |
||||
# the organization's ftp site. |
||||
# |
||||
# OLD5601.TXT format: |
||||
# KSC5601 code in hex |
||||
# UCS-2 code in hex |
||||
# # and Unicode name (not used in this script) |
||||
|
||||
require "ucs2utf.pl"; |
||||
|
||||
# first generate UTF-8 --> WIN949 table |
||||
|
||||
$in_file = "CP874.TXT"; |
||||
|
||||
open( FILE, $in_file ) || die( "cannot open $in_file" ); |
||||
|
||||
while( <FILE> ){ |
||||
chop; |
||||
if( /^#/ ){ |
||||
next; |
||||
} |
||||
( $c, $u, $rest ) = split; |
||||
$ucs = hex($u); |
||||
$code = hex($c); |
||||
if( $code >= 0x80 && $ucs >= 0x0080 ){ |
||||
$utf = &ucs2utf($ucs); |
||||
if( $array{ $utf } ne "" ){ |
||||
printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; |
||||
next; |
||||
} |
||||
$count++; |
||||
|
||||
$array{ $utf } = $code; |
||||
} |
||||
} |
||||
close( FILE ); |
||||
|
||||
# |
||||
# first, generate UTF8 --> WIN874 table |
||||
# |
||||
|
||||
$file = "utf8_to_win874.map"; |
||||
open( FILE, "> $file" ) || die( "cannot open $file" ); |
||||
print FILE "static pg_utf_to_local ULmapWIN874[ $count ] = {\n"; |
||||
|
||||
for $index ( sort {$a <=> $b} keys( %array ) ){ |
||||
$code = $array{ $index }; |
||||
$count--; |
||||
if( $count == 0 ){ |
||||
printf FILE " {0x%04x, 0x%04x}\n", $index, $code; |
||||
} else { |
||||
printf FILE " {0x%04x, 0x%04x},\n", $index, $code; |
||||
} |
||||
} |
||||
|
||||
print FILE "};\n"; |
||||
close(FILE); |
||||
|
||||
# |
||||
# then generate WIN874 --> UTF8 table |
||||
# |
||||
reset 'array'; |
||||
|
||||
open( FILE, $in_file ) || die( "cannot open $in_file" ); |
||||
|
||||
while( <FILE> ){ |
||||
chop; |
||||
if( /^#/ ){ |
||||
next; |
||||
} |
||||
( $c, $u, $rest ) = split; |
||||
$ucs = hex($u); |
||||
$code = hex($c); |
||||
if( $code >= 0x80 && $ucs >= 0x0080 ){ |
||||
$utf = &ucs2utf($ucs); |
||||
if( $array{ $code } ne "" ){ |
||||
printf STDERR "Warning: duplicate code: %04x\n",$ucs; |
||||
next; |
||||
} |
||||
$count++; |
||||
|
||||
$array{ $code } = $utf; |
||||
} |
||||
} |
||||
close( FILE ); |
||||
|
||||
$file = "win874_to_utf8.map"; |
||||
open( FILE, "> $file" ) || die( "cannot open $file" ); |
||||
print FILE "static pg_local_to_utf LUmapWIN874[ $count ] = {\n"; |
||||
for $index ( sort {$a <=> $b} keys( %array ) ){ |
||||
$utf = $array{ $index }; |
||||
$count--; |
||||
if( $count == 0 ){ |
||||
printf FILE " {0x%04x, 0x%04x}\n", $index, $utf; |
||||
} else { |
||||
printf FILE " {0x%04x, 0x%04x},\n", $index, $utf; |
||||
} |
||||
} |
||||
|
||||
print FILE "};\n"; |
||||
close(FILE); |
@ -1,112 +0,0 @@ |
||||
#! /usr/bin/perl |
||||
# |
||||
# Copyright (c) 2001-2005, PostgreSQL Global Development Group |
||||
# |
||||
# $PostgreSQL: pgsql/src/backend/utils/mb/Unicode/UCS_to_cyrillic.pl,v 1.7 2005/03/07 04:30:52 momjian Exp $ |
||||
# |
||||
# Generate UTF-8 <--> ISO8859 code conversion tables from |
||||
# map files provided by Unicode organization. |
||||
# Unfortunately it is prohibited by the organization |
||||
# to distribute the map files. So if you try to use this script, |
||||
# you have to obtain "8859-[2-5].TXT" from the organization's ftp site. |
||||
# We assume the file include three tab-separated columns: |
||||
# ISO/IEC 8859 code in hex |
||||
# UCS-2 code in hex |
||||
# # and Unicode name (not used in this script) |
||||
|
||||
require "ucs2utf.pl"; |
||||
%filename = ('KOI8R'=>'koi8-r.txt', |
||||
'WIN1251'=>'cp1251.txt', |
||||
'WIN866'=>'cp866.txt'); |
||||
@charsets = ('KOI8R','WIN866','WIN1251'); |
||||
foreach $charset (@charsets) { |
||||
|
||||
# |
||||
# first, generate UTF8->ISO8859 table |
||||
# |
||||
$in_file = $filename{$charset}; |
||||
|
||||
open( FILE, $in_file ) || die( "cannot open $in_file" ); |
||||
|
||||
reset 'array'; |
||||
|
||||
while( <FILE> ){ |
||||
chop; |
||||
if( /^#/ ){ |
||||
next; |
||||
} |
||||
( $c, $u, $rest ) = split; |
||||
$ucs = hex($u); |
||||
$code = hex($c); |
||||
if( $code >= 0x80){ |
||||
$utf = &ucs2utf($ucs); |
||||
if( $array{ $utf } ne "" ){ |
||||
printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; |
||||
next; |
||||
} |
||||
$count++; |
||||
$array{ $utf } = $code; |
||||
} |
||||
} |
||||
close( FILE ); |
||||
|
||||
$file = "utf8_to_${charset}.map"; |
||||
open( FILE, "> $file" ) || die( "cannot open $file" ); |
||||
print FILE "static pg_utf_to_local ULmap_${charset}[ $count ] = {\n"; |
||||
|
||||
for $index ( sort {$a <=> $b} keys( %array ) ){ |
||||
$code = $array{ $index }; |
||||
$count--; |
||||
if( $count == 0 ){ |
||||
printf FILE " {0x%04x, 0x%04x}\n", $index, $code; |
||||
} else { |
||||
printf FILE " {0x%04x, 0x%04x},\n", $index, $code; |
||||
} |
||||
} |
||||
|
||||
print FILE "};\n"; |
||||
close(FILE); |
||||
|
||||
# |
||||
# then generate ISO885->UTF8 table |
||||
# |
||||
open( FILE, $in_file ) || die( "cannot open $in_file" ); |
||||
|
||||
reset 'array'; |
||||
|
||||
while( <FILE> ){ |
||||
chop; |
||||
if( /^#/ ){ |
||||
next; |
||||
} |
||||
( $c, $u, $rest ) = split; |
||||
$ucs = hex($u); |
||||
$code = hex($c); |
||||
if($code >= 0x80){ |
||||
$utf = &ucs2utf($ucs); |
||||
if( $array{ $utf } ne "" ){ |
||||
printf STDERR "Warning: duplicate UTF8: %04x\n",$ucs; |
||||
next; |
||||
} |
||||
$count++; |
||||
$array{ $code } = $utf; |
||||
} |
||||
} |
||||
close( FILE ); |
||||
|
||||
$file = "${charset}_to_utf8.map"; |
||||
open( FILE, "> $file" ) || die( "cannot open $file" ); |
||||
print FILE "static pg_local_to_utf LUmap${charset}[ $count ] = {\n"; |
||||
for $index ( sort {$a <=> $b} keys( %array ) ){ |
||||
$utf = $array{ $index }; |
||||
$count--; |
||||
if( $count == 0 ){ |
||||
printf FILE " {0x%04x, 0x%04x}\n", $index, $utf; |
||||
} else { |
||||
printf FILE " {0x%04x, 0x%04x},\n", $index, $utf; |
||||
} |
||||
} |
||||
|
||||
print FILE "};\n"; |
||||
close(FILE); |
||||
} |
@ -0,0 +1,113 @@ |
||||
static pg_utf_to_local ULmapWIN1253[ 111 ] = { |
||||
{0xc2a0, 0x00a0}, |
||||
{0xc2a3, 0x00a3}, |
||||
{0xc2a4, 0x00a4}, |
||||
{0xc2a5, 0x00a5}, |
||||
{0xc2a6, 0x00a6}, |
||||
{0xc2a7, 0x00a7}, |
||||
{0xc2a8, 0x00a8}, |
||||
{0xc2a9, 0x00a9}, |
||||
{0xc2ab, 0x00ab}, |
||||
{0xc2ac, 0x00ac}, |
||||
{0xc2ad, 0x00ad}, |
||||
{0xc2ae, 0x00ae}, |
||||
{0xc2b0, 0x00b0}, |
||||
{0xc2b1, 0x00b1}, |
||||
{0xc2b2, 0x00b2}, |
||||
{0xc2b3, 0x00b3}, |
||||
{0xc2b5, 0x00b5}, |
||||
{0xc2b6, 0x00b6}, |
||||
{0xc2b7, 0x00b7}, |
||||
{0xc2bb, 0x00bb}, |
||||
{0xc2bd, 0x00bd}, |
||||
{0xc692, 0x0083}, |
||||
{0xce84, 0x00b4}, |
||||
{0xce85, 0x00a1}, |
||||
{0xce86, 0x00a2}, |
||||
{0xce88, 0x00b8}, |
||||
{0xce89, 0x00b9}, |
||||
{0xce8a, 0x00ba}, |
||||
{0xce8c, 0x00bc}, |
||||
{0xce8e, 0x00be}, |
||||
{0xce8f, 0x00bf}, |
||||
{0xce90, 0x00c0}, |
||||
{0xce91, 0x00c1}, |
||||
{0xce92, 0x00c2}, |
||||
{0xce93, 0x00c3}, |
||||
{0xce94, 0x00c4}, |
||||
{0xce95, 0x00c5}, |
||||
{0xce96, 0x00c6}, |
||||
{0xce97, 0x00c7}, |
||||
{0xce98, 0x00c8}, |
||||
{0xce99, 0x00c9}, |
||||
{0xce9a, 0x00ca}, |
||||
{0xce9b, 0x00cb}, |
||||
{0xce9c, 0x00cc}, |
||||
{0xce9d, 0x00cd}, |
||||
{0xce9e, 0x00ce}, |
||||
{0xce9f, 0x00cf}, |
||||
{0xcea0, 0x00d0}, |
||||
{0xcea1, 0x00d1}, |
||||
{0xcea3, 0x00d3}, |
||||
{0xcea4, 0x00d4}, |
||||
{0xcea5, 0x00d5}, |
||||
{0xcea6, 0x00d6}, |
||||
{0xcea7, 0x00d7}, |
||||
{0xcea8, 0x00d8}, |
||||
{0xcea9, 0x00d9}, |
||||
{0xceaa, 0x00da}, |
||||
{0xceab, 0x00db}, |
||||
{0xceac, 0x00dc}, |
||||
{0xcead, 0x00dd}, |
||||
{0xceae, 0x00de}, |
||||
{0xceaf, 0x00df}, |
||||
{0xceb0, 0x00e0}, |
||||
{0xceb1, 0x00e1}, |
||||
{0xceb2, 0x00e2}, |
||||
{0xceb3, 0x00e3}, |
||||
{0xceb4, 0x00e4}, |
||||
{0xceb5, 0x00e5}, |
||||
{0xceb6, 0x00e6}, |
||||
{0xceb7, 0x00e7}, |
||||
{0xceb8, 0x00e8}, |
||||
{0xceb9, 0x00e9}, |
||||
{0xceba, 0x00ea}, |
||||
{0xcebb, 0x00eb}, |
||||
{0xcebc, 0x00ec}, |
||||
{0xcebd, 0x00ed}, |
||||
{0xcebe, 0x00ee}, |
||||
{0xcebf, 0x00ef}, |
||||
{0xcf80, 0x00f0}, |
||||
{0xcf81, 0x00f1}, |
||||
{0xcf82, 0x00f2}, |
||||
{0xcf83, 0x00f3}, |
||||
{0xcf84, 0x00f4}, |
||||
{0xcf85, 0x00f5}, |
||||
{0xcf86, 0x00f6}, |
||||
{0xcf87, 0x00f7}, |
||||
{0xcf88, 0x00f8}, |
||||
{0xcf89, 0x00f9}, |
||||
{0xcf8a, 0x00fa}, |
||||
{0xcf8b, 0x00fb}, |
||||
{0xcf8c, 0x00fc}, |
||||
{0xcf8d, 0x00fd}, |
||||
{0xcf8e, 0x00fe}, |
||||
{0xe28093, 0x0096}, |
||||
{0xe28094, 0x0097}, |
||||
{0xe28095, 0x00af}, |
||||
{0xe28098, 0x0091}, |
||||
{0xe28099, 0x0092}, |
||||
{0xe2809a, 0x0082}, |
||||
{0xe2809c, 0x0093}, |
||||
{0xe2809d, 0x0094}, |
||||
{0xe2809e, 0x0084}, |
||||
{0xe280a0, 0x0086}, |
||||
{0xe280a1, 0x0087}, |
||||
{0xe280a2, 0x0095}, |
||||
{0xe280a6, 0x0085}, |
||||
{0xe280b0, 0x0089}, |
||||
{0xe280b9, 0x008b}, |
||||
{0xe280ba, 0x009b}, |
||||
{0xe282ac, 0x0080}, |
||||
{0xe284a2, 0x0099} |
||||
}; |
@ -0,0 +1,123 @@ |
||||
static pg_utf_to_local ULmapWIN1254[ 121 ] = { |
||||
{0xc2a0, 0x00a0}, |
||||
{0xc2a1, 0x00a1}, |
||||
{0xc2a2, 0x00a2}, |
||||
{0xc2a3, 0x00a3}, |
||||
{0xc2a4, 0x00a4}, |
||||
{0xc2a5, 0x00a5}, |
||||
{0xc2a6, 0x00a6}, |
||||
{0xc2a7, 0x00a7}, |
||||
{0xc2a8, 0x00a8}, |
||||
{0xc2a9, 0x00a9}, |
||||
{0xc2aa, 0x00aa}, |
||||
{0xc2ab, 0x00ab}, |
||||
{0xc2ac, 0x00ac}, |
||||
{0xc2ad, 0x00ad}, |
||||
{0xc2ae, 0x00ae}, |
||||
{0xc2af, 0x00af}, |
||||
{0xc2b0, 0x00b0}, |
||||
{0xc2b1, 0x00b1}, |
||||
{0xc2b2, 0x00b2}, |
||||
{0xc2b3, 0x00b3}, |
||||
{0xc2b4, 0x00b4}, |
||||
{0xc2b5, 0x00b5}, |
||||
{0xc2b6, 0x00b6}, |
||||
{0xc2b7, 0x00b7}, |
||||
{0xc2b8, 0x00b8}, |
||||
{0xc2b9, 0x00b9}, |
||||
{0xc2ba, 0x00ba}, |
||||
{0xc2bb, 0x00bb}, |
||||
{0xc2bc, 0x00bc}, |
||||
{0xc2bd, 0x00bd}, |
||||
{0xc2be, 0x00be}, |
||||
{0xc2bf, 0x00bf}, |
||||
{0xc380, 0x00c0}, |
||||
{0xc381, 0x00c1}, |
||||
{0xc382, 0x00c2}, |
||||
{0xc383, 0x00c3}, |
||||
{0xc384, 0x00c4}, |
||||
{0xc385, 0x00c5}, |
||||
{0xc386, 0x00c6}, |
||||
{0xc387, 0x00c7}, |
||||
{0xc388, 0x00c8}, |
||||
{0xc389, 0x00c9}, |
||||
{0xc38a, 0x00ca}, |
||||
{0xc38b, 0x00cb}, |
||||
{0xc38c, 0x00cc}, |
||||
{0xc38d, 0x00cd}, |
||||
{0xc38e, 0x00ce}, |
||||
{0xc38f, 0x00cf}, |
||||
{0xc391, 0x00d1}, |
||||
{0xc392, 0x00d2}, |
||||
{0xc393, 0x00d3}, |
||||
{0xc394, 0x00d4}, |
||||
{0xc395, 0x00d5}, |
||||
{0xc396, 0x00d6}, |
||||
{0xc397, 0x00d7}, |
||||
{0xc398, 0x00d8}, |
||||
{0xc399, 0x00d9}, |
||||
{0xc39a, 0x00da}, |
||||
{0xc39b, 0x00db}, |
||||
{0xc39c, 0x00dc}, |
||||
{0xc39f, 0x00df}, |
||||
{0xc3a0, 0x00e0}, |
||||
{0xc3a1, 0x00e1}, |
||||
{0xc3a2, 0x00e2}, |
||||
{0xc3a3, 0x00e3}, |
||||
{0xc3a4, 0x00e4}, |
||||
{0xc3a5, 0x00e5}, |
||||
{0xc3a6, 0x00e6}, |
||||
{0xc3a7, 0x00e7}, |
||||
{0xc3a8, 0x00e8}, |
||||
{0xc3a9, 0x00e9}, |
||||
{0xc3aa, 0x00ea}, |
||||
{0xc3ab, 0x00eb}, |
||||
{0xc3ac, 0x00ec}, |
||||
{0xc3ad, 0x00ed}, |
||||
{0xc3ae, 0x00ee}, |
||||
{0xc3af, 0x00ef}, |
||||
{0xc3b1, 0x00f1}, |
||||
{0xc3b2, 0x00f2}, |
||||
{0xc3b3, 0x00f3}, |
||||
{0xc3b4, 0x00f4}, |
||||
{0xc3b5, 0x00f5}, |
||||
{0xc3b6, 0x00f6}, |
||||
{0xc3b7, 0x00f7}, |
||||
{0xc3b8, 0x00f8}, |
||||
{0xc3b9, 0x00f9}, |
||||
{0xc3ba, 0x00fa}, |
||||
{0xc3bb, 0x00fb}, |
||||
{0xc3bc, 0x00fc}, |
||||
{0xc3bf, 0x00ff}, |
||||
{0xc49e, 0x00d0}, |
||||
{0xc49f, 0x00f0}, |
||||
{0xc4b0, 0x00dd}, |
||||
{0xc4b1, 0x00fd}, |
||||
{0xc592, 0x008c}, |
||||
{0xc593, 0x009c}, |
||||
{0xc59e, 0x00de}, |
||||
{0xc59f, 0x00fe}, |
||||
{0xc5a0, 0x008a}, |
||||
{0xc5a1, 0x009a}, |
||||
{0xc5b8, 0x009f}, |
||||
{0xc692, 0x0083}, |
||||
{0xcb86, 0x0088}, |
||||
{0xcb9c, 0x0098}, |
||||
{0xe28093, 0x0096}, |
||||
{0xe28094, 0x0097}, |
||||
{0xe28098, 0x0091}, |
||||
{0xe28099, 0x0092}, |
||||
{0xe2809a, 0x0082}, |
||||
{0xe2809c, 0x0093}, |
||||
{0xe2809d, 0x0094}, |
||||
{0xe2809e, 0x0084}, |
||||
{0xe280a0, 0x0086}, |
||||
{0xe280a1, 0x0087}, |
||||
{0xe280a2, 0x0095}, |
||||
{0xe280a6, 0x0085}, |
||||
{0xe280b0, 0x0089}, |
||||
{0xe280b9, 0x008b}, |
||||
{0xe280ba, 0x009b}, |
||||
{0xe282ac, 0x0080}, |
||||
{0xe284a2, 0x0099} |
||||
}; |
@ -0,0 +1,107 @@ |
||||
static pg_utf_to_local ULmapWIN1255[ 105 ] = { |
||||
{0xc2a0, 0x00a0}, |
||||
{0xc2a1, 0x00a1}, |
||||
{0xc2a2, 0x00a2}, |
||||
{0xc2a3, 0x00a3}, |
||||
{0xc2a5, 0x00a5}, |
||||
{0xc2a6, 0x00a6}, |
||||
{0xc2a7, 0x00a7}, |
||||
{0xc2a8, 0x00a8}, |
||||
{0xc2a9, 0x00a9}, |
||||
{0xc2ab, 0x00ab}, |
||||
{0xc2ac, 0x00ac}, |
||||
{0xc2ad, 0x00ad}, |
||||
{0xc2ae, 0x00ae}, |
||||
{0xc2af, 0x00af}, |
||||
{0xc2b0, 0x00b0}, |
||||
{0xc2b1, 0x00b1}, |
||||
{0xc2b2, 0x00b2}, |
||||
{0xc2b3, 0x00b3}, |
||||
{0xc2b4, 0x00b4}, |
||||
{0xc2b5, 0x00b5}, |
||||
{0xc2b6, 0x00b6}, |
||||
{0xc2b7, 0x00b7}, |
||||
{0xc2b8, 0x00b8}, |
||||
{0xc2b9, 0x00b9}, |
||||
{0xc2bb, 0x00bb}, |
||||
{0xc2bc, 0x00bc}, |
||||
{0xc2bd, 0x00bd}, |
||||
{0xc2be, 0x00be}, |
||||
{0xc2bf, 0x00bf}, |
||||
{0xc397, 0x00aa}, |
||||
{0xc3b7, 0x00ba}, |
||||
{0xc692, 0x0083}, |
||||
{0xcb86, 0x0088}, |
||||
{0xcb9c, 0x0098}, |
||||
{0xd6b0, 0x00c0}, |
||||
{0xd6b1, 0x00c1}, |
||||
{0xd6b2, 0x00c2}, |
||||
{0xd6b3, 0x00c3}, |
||||
{0xd6b4, 0x00c4}, |
||||
{0xd6b5, 0x00c5}, |
||||
{0xd6b6, 0x00c6}, |
||||
{0xd6b7, 0x00c7}, |
||||
{0xd6b8, 0x00c8}, |
||||
{0xd6b9, 0x00c9}, |
||||
{0xd6bb, 0x00cb}, |
||||
{0xd6bc, 0x00cc}, |
||||
{0xd6bd, 0x00cd}, |
||||
{0xd6be, 0x00ce}, |
||||
{0xd6bf, 0x00cf}, |
||||
{0xd780, 0x00d0}, |
||||
{0xd781, 0x00d1}, |
||||
{0xd782, 0x00d2}, |
||||
{0xd783, 0x00d3}, |
||||
{0xd790, 0x00e0}, |
||||
{0xd791, 0x00e1}, |
||||
{0xd792, 0x00e2}, |
||||
{0xd793, 0x00e3}, |
||||
{0xd794, 0x00e4}, |
||||
{0xd795, 0x00e5}, |
||||
{0xd796, 0x00e6}, |
||||
{0xd797, 0x00e7}, |
||||
{0xd798, 0x00e8}, |
||||
{0xd799, 0x00e9}, |
||||
{0xd79a, 0x00ea}, |
||||
{0xd79b, 0x00eb}, |
||||
{0xd79c, 0x00ec}, |
||||
{0xd79d, 0x00ed}, |
||||
{0xd79e, 0x00ee}, |
||||
{0xd79f, 0x00ef}, |
||||
{0xd7a0, 0x00f0}, |
||||
{0xd7a1, 0x00f1}, |
||||
{0xd7a2, 0x00f2}, |
||||
{0xd7a3, 0x00f3}, |
||||
{0xd7a4, 0x00f4}, |
||||
{0xd7a5, 0x00f5}, |
||||
{0xd7a6, 0x00f6}, |
||||
{0xd7a7, 0x00f7}, |
||||
{0xd7a8, 0x00f8}, |
||||
{0xd7a9, 0x00f9}, |
||||
{0xd7aa, 0x00fa}, |
||||
{0xd7b0, 0x00d4}, |
||||
{0xd7b1, 0x00d5}, |
||||
{0xd7b2, 0x00d6}, |
||||
{0xd7b3, 0x00d7}, |
||||
{0xd7b4, 0x00d8}, |
||||
{0xe2808e, 0x00fd}, |
||||
{0xe2808f, 0x00fe}, |
||||
{0xe28093, 0x0096}, |
||||
{0xe28094, 0x0097}, |
||||
{0xe28098, 0x0091}, |
||||
{0xe28099, 0x0092}, |
||||
{0xe2809a, 0x0082}, |
||||
{0xe2809c, 0x0093}, |
||||
{0xe2809d, 0x0094}, |
||||
{0xe2809e, 0x0084}, |
||||
{0xe280a0, 0x0086}, |
||||
{0xe280a1, 0x0087}, |
||||
{0xe280a2, 0x0095}, |
||||
{0xe280a6, 0x0085}, |
||||
{0xe280b0, 0x0089}, |
||||
{0xe280b9, 0x008b}, |
||||
{0xe280ba, 0x009b}, |
||||
{0xe282aa, 0x00a4}, |
||||
{0xe282ac, 0x0080}, |
||||
{0xe284a2, 0x0099} |
||||
}; |
@ -0,0 +1,118 @@ |
||||
static pg_utf_to_local ULmapWIN1257[ 116 ] = { |
||||
{0xc2a0, 0x00a0}, |
||||
{0xc2a2, 0x00a2}, |
||||
{0xc2a3, 0x00a3}, |
||||
{0xc2a4, 0x00a4}, |
||||
{0xc2a6, 0x00a6}, |
||||
{0xc2a7, 0x00a7}, |
||||
{0xc2a8, 0x008d}, |
||||
{0xc2a9, 0x00a9}, |
||||
{0xc2ab, 0x00ab}, |
||||
{0xc2ac, 0x00ac}, |
||||
{0xc2ad, 0x00ad}, |
||||
{0xc2ae, 0x00ae}, |
||||
{0xc2af, 0x009d}, |
||||
{0xc2b0, 0x00b0}, |
||||
{0xc2b1, 0x00b1}, |
||||
{0xc2b2, 0x00b2}, |
||||
{0xc2b3, 0x00b3}, |
||||
{0xc2b4, 0x00b4}, |
||||
{0xc2b5, 0x00b5}, |
||||
{0xc2b6, 0x00b6}, |
||||
{0xc2b7, 0x00b7}, |
||||
{0xc2b8, 0x008f}, |
||||
{0xc2b9, 0x00b9}, |
||||
{0xc2bb, 0x00bb}, |
||||
{0xc2bc, 0x00bc}, |
||||
{0xc2bd, 0x00bd}, |
||||
{0xc2be, 0x00be}, |
||||
{0xc384, 0x00c4}, |
||||
{0xc385, 0x00c5}, |
||||
{0xc386, 0x00af}, |
||||
{0xc389, 0x00c9}, |
||||
{0xc393, 0x00d3}, |
||||
{0xc395, 0x00d5}, |
||||
{0xc396, 0x00d6}, |
||||
{0xc397, 0x00d7}, |
||||
{0xc398, 0x00a8}, |
||||
{0xc39c, 0x00dc}, |
||||
{0xc39f, 0x00df}, |
||||
{0xc3a4, 0x00e4}, |
||||
{0xc3a5, 0x00e5}, |
||||
{0xc3a6, 0x00bf}, |
||||
{0xc3a9, 0x00e9}, |
||||
{0xc3b3, 0x00f3}, |
||||
{0xc3b5, 0x00f5}, |
||||
{0xc3b6, 0x00f6}, |
||||
{0xc3b7, 0x00f7}, |
||||
{0xc3b8, 0x00b8}, |
||||
{0xc3bc, 0x00fc}, |
||||
{0xc480, 0x00c2}, |
||||
{0xc481, 0x00e2}, |
||||
{0xc484, 0x00c0}, |
||||
{0xc485, 0x00e0}, |
||||
{0xc486, 0x00c3}, |
||||
{0xc487, 0x00e3}, |
||||
{0xc48c, 0x00c8}, |
||||
{0xc48d, 0x00e8}, |
||||
{0xc492, 0x00c7}, |
||||
{0xc493, 0x00e7}, |
||||
{0xc496, 0x00cb}, |
||||
{0xc497, 0x00eb}, |
||||
{0xc498, 0x00c6}, |
||||
{0xc499, 0x00e6}, |
||||
{0xc4a2, 0x00cc}, |
||||
{0xc4a3, 0x00ec}, |
||||
{0xc4aa, 0x00ce}, |
||||
{0xc4ab, 0x00ee}, |
||||
{0xc4ae, 0x00c1}, |
||||
{0xc4af, 0x00e1}, |
||||
{0xc4b6, 0x00cd}, |
||||
{0xc4b7, 0x00ed}, |
||||
{0xc4bb, 0x00cf}, |
||||
{0xc4bc, 0x00ef}, |
||||
{0xc581, 0x00d9}, |
||||
{0xc582, 0x00f9}, |
||||
{0xc583, 0x00d1}, |
||||
{0xc584, 0x00f1}, |
||||
{0xc585, 0x00d2}, |
||||
{0xc586, 0x00f2}, |
||||
{0xc58c, 0x00d4}, |
||||
{0xc58d, 0x00f4}, |
||||
{0xc596, 0x00aa}, |
||||
{0xc597, 0x00ba}, |
||||
{0xc59a, 0x00da}, |
||||
{0xc59b, 0x00fa}, |
||||
{0xc5a0, 0x00d0}, |
||||
{0xc5a1, 0x00f0}, |
||||
{0xc5aa, 0x00db}, |
||||
{0xc5ab, 0x00fb}, |
||||
{0xc5b2, 0x00d8}, |
||||
{0xc5b3, 0x00f8}, |
||||
{0xc5b9, 0x00ca}, |
||||
{0xc5ba, 0x00ea}, |
||||
{0xc5bb, 0x00dd}, |
||||
{0xc5bc, 0x00fd}, |
||||
{0xc5bd, 0x00de}, |
||||
{0xc5be, 0x00fe}, |
||||
{0xcb87, 0x008e}, |
||||
{0xcb99, 0x00ff}, |
||||
{0xcb9b, 0x009e}, |
||||
{0xe28093, 0x0096}, |
||||
{0xe28094, 0x0097}, |
||||
{0xe28098, 0x0091}, |
||||
{0xe28099, 0x0092}, |
||||
{0xe2809a, 0x0082}, |
||||
{0xe2809c, 0x0093}, |
||||
{0xe2809d, 0x0094}, |
||||
{0xe2809e, 0x0084}, |
||||
{0xe280a0, 0x0086}, |
||||
{0xe280a1, 0x0087}, |
||||
{0xe280a2, 0x0095}, |
||||
{0xe280a6, 0x0085}, |
||||
{0xe280b0, 0x0089}, |
||||
{0xe280b9, 0x008b}, |
||||
{0xe280ba, 0x009b}, |
||||
{0xe282ac, 0x0080}, |
||||
{0xe284a2, 0x0099} |
||||
}; |
@ -0,0 +1,113 @@ |
||||
static pg_local_to_utf LUmapWIN1253[ 111 ] = { |
||||
{0x0080, 0xe282ac}, |
||||
{0x0082, 0xe2809a}, |
||||
{0x0083, 0xc692}, |
||||
{0x0084, 0xe2809e}, |
||||
{0x0085, 0xe280a6}, |
||||
{0x0086, 0xe280a0}, |
||||
{0x0087, 0xe280a1}, |
||||
{0x0089, 0xe280b0}, |
||||
{0x008b, 0xe280b9}, |
||||
{0x0091, 0xe28098}, |
||||
{0x0092, 0xe28099}, |
||||
{0x0093, 0xe2809c}, |
||||
{0x0094, 0xe2809d}, |
||||
{0x0095, 0xe280a2}, |
||||
{0x0096, 0xe28093}, |
||||
{0x0097, 0xe28094}, |
||||
{0x0099, 0xe284a2}, |
||||
{0x009b, 0xe280ba}, |
||||
{0x00a0, 0xc2a0}, |
||||
{0x00a1, 0xce85}, |
||||
{0x00a2, 0xce86}, |
||||
{0x00a3, 0xc2a3}, |
||||
{0x00a4, 0xc2a4}, |
||||
{0x00a5, 0xc2a5}, |
||||
{0x00a6, 0xc2a6}, |
||||
{0x00a7, 0xc2a7}, |
||||
{0x00a8, 0xc2a8}, |
||||
{0x00a9, 0xc2a9}, |
||||
{0x00ab, 0xc2ab}, |
||||
{0x00ac, 0xc2ac}, |
||||
{0x00ad, 0xc2ad}, |
||||
{0x00ae, 0xc2ae}, |
||||
{0x00af, 0xe28095}, |
||||
{0x00b0, 0xc2b0}, |
||||
{0x00b1, 0xc2b1}, |
||||
{0x00b2, 0xc2b2}, |
||||
{0x00b3, 0xc2b3}, |
||||
{0x00b4, 0xce84}, |
||||
{0x00b5, 0xc2b5}, |
||||
{0x00b6, 0xc2b6}, |
||||
{0x00b7, 0xc2b7}, |
||||
{0x00b8, 0xce88}, |
||||
{0x00b9, 0xce89}, |
||||
{0x00ba, 0xce8a}, |
||||
{0x00bb, 0xc2bb}, |
||||
{0x00bc, 0xce8c}, |
||||
{0x00bd, 0xc2bd}, |
||||
{0x00be, 0xce8e}, |
||||
{0x00bf, 0xce8f}, |
||||
{0x00c0, 0xce90}, |
||||
{0x00c1, 0xce91}, |
||||
{0x00c2, 0xce92}, |
||||
{0x00c3, 0xce93}, |
||||
{0x00c4, 0xce94}, |
||||
{0x00c5, 0xce95}, |
||||
{0x00c6, 0xce96}, |
||||
{0x00c7, 0xce97}, |
||||
{0x00c8, 0xce98}, |
||||
{0x00c9, 0xce99}, |
||||
{0x00ca, 0xce9a}, |
||||
{0x00cb, 0xce9b}, |
||||
{0x00cc, 0xce9c}, |
||||
{0x00cd, 0xce9d}, |
||||
{0x00ce, 0xce9e}, |
||||
{0x00cf, 0xce9f}, |
||||
{0x00d0, 0xcea0}, |
||||
{0x00d1, 0xcea1}, |
||||
{0x00d3, 0xcea3}, |
||||
{0x00d4, 0xcea4}, |
||||
{0x00d5, 0xcea5}, |
||||
{0x00d6, 0xcea6}, |
||||
{0x00d7, 0xcea7}, |
||||
{0x00d8, 0xcea8}, |
||||
{0x00d9, 0xcea9}, |
||||
{0x00da, 0xceaa}, |
||||
{0x00db, 0xceab}, |
||||
{0x00dc, 0xceac}, |
||||
{0x00dd, 0xcead}, |
||||
{0x00de, 0xceae}, |
||||
{0x00df, 0xceaf}, |
||||
{0x00e0, 0xceb0}, |
||||
{0x00e1, 0xceb1}, |
||||
{0x00e2, 0xceb2}, |
||||
{0x00e3, 0xceb3}, |
||||
{0x00e4, 0xceb4}, |
||||
{0x00e5, 0xceb5}, |
||||
{0x00e6, 0xceb6}, |
||||
{0x00e7, 0xceb7}, |
||||
{0x00e8, 0xceb8}, |
||||
{0x00e9, 0xceb9}, |
||||
{0x00ea, 0xceba}, |
||||
{0x00eb, 0xcebb}, |
||||
{0x00ec, 0xcebc}, |
||||
{0x00ed, 0xcebd}, |
||||
{0x00ee, 0xcebe}, |
||||
{0x00ef, 0xcebf}, |
||||
{0x00f0, 0xcf80}, |
||||
{0x00f1, 0xcf81}, |
||||
{0x00f2, 0xcf82}, |
||||
{0x00f3, 0xcf83}, |
||||
{0x00f4, 0xcf84}, |
||||
{0x00f5, 0xcf85}, |
||||
{0x00f6, 0xcf86}, |
||||
{0x00f7, 0xcf87}, |
||||
{0x00f8, 0xcf88}, |
||||
{0x00f9, 0xcf89}, |
||||
{0x00fa, 0xcf8a}, |
||||
{0x00fb, 0xcf8b}, |
||||
{0x00fc, 0xcf8c}, |
||||
{0x00fd, 0xcf8d}, |
||||
{0x00fe, 0xcf8e} |
||||
}; |
@ -0,0 +1,123 @@ |
||||
static pg_local_to_utf LUmapWIN1254[ 121 ] = { |
||||
{0x0080, 0xe282ac}, |
||||
{0x0082, 0xe2809a}, |
||||
{0x0083, 0xc692}, |
||||
{0x0084, 0xe2809e}, |
||||
{0x0085, 0xe280a6}, |
||||
{0x0086, 0xe280a0}, |
||||
{0x0087, 0xe280a1}, |
||||
{0x0088, 0xcb86}, |
||||
{0x0089, 0xe280b0}, |
||||
{0x008a, 0xc5a0}, |
||||
{0x008b, 0xe280b9}, |
||||
{0x008c, 0xc592}, |
||||
{0x0091, 0xe28098}, |
||||
{0x0092, 0xe28099}, |
||||
{0x0093, 0xe2809c}, |
||||
{0x0094, 0xe2809d}, |
||||
{0x0095, 0xe280a2}, |
||||
{0x0096, 0xe28093}, |
||||
{0x0097, 0xe28094}, |
||||
{0x0098, 0xcb9c}, |
||||
{0x0099, 0xe284a2}, |
||||
{0x009a, 0xc5a1}, |
||||
{0x009b, 0xe280ba}, |
||||
{0x009c, 0xc593}, |
||||
{0x009f, 0xc5b8}, |
||||
{0x00a0, 0xc2a0}, |
||||
{0x00a1, 0xc2a1}, |
||||
{0x00a2, 0xc2a2}, |
||||
{0x00a3, 0xc2a3}, |
||||
{0x00a4, 0xc2a4}, |
||||
{0x00a5, 0xc2a5}, |
||||
{0x00a6, 0xc2a6}, |
||||
{0x00a7, 0xc2a7}, |
||||
{0x00a8, 0xc2a8}, |
||||
{0x00a9, 0xc2a9}, |
||||
{0x00aa, 0xc2aa}, |
||||
{0x00ab, 0xc2ab}, |
||||
{0x00ac, 0xc2ac}, |
||||
{0x00ad, 0xc2ad}, |
||||
{0x00ae, 0xc2ae}, |
||||
{0x00af, 0xc2af}, |
||||
{0x00b0, 0xc2b0}, |
||||
{0x00b1, 0xc2b1}, |
||||
{0x00b2, 0xc2b2}, |
||||
{0x00b3, 0xc2b3}, |
||||
{0x00b4, 0xc2b4}, |
||||
{0x00b5, 0xc2b5}, |
||||
{0x00b6, 0xc2b6}, |
||||
{0x00b7, 0xc2b7}, |
||||
{0x00b8, 0xc2b8}, |
||||
{0x00b9, 0xc2b9}, |
||||
{0x00ba, 0xc2ba}, |
||||
{0x00bb, 0xc2bb}, |
||||
{0x00bc, 0xc2bc}, |
||||
{0x00bd, 0xc2bd}, |
||||
{0x00be, 0xc2be}, |
||||
{0x00bf, 0xc2bf}, |
||||
{0x00c0, 0xc380}, |
||||
{0x00c1, 0xc381}, |
||||
{0x00c2, 0xc382}, |
||||
{0x00c3, 0xc383}, |
||||
{0x00c4, 0xc384}, |
||||
{0x00c5, 0xc385}, |
||||
{0x00c6, 0xc386}, |
||||
{0x00c7, 0xc387}, |
||||
{0x00c8, 0xc388}, |
||||
{0x00c9, 0xc389}, |
||||
{0x00ca, 0xc38a}, |
||||
{0x00cb, 0xc38b}, |
||||
{0x00cc, 0xc38c}, |
||||
{0x00cd, 0xc38d}, |
||||
{0x00ce, 0xc38e}, |
||||
{0x00cf, 0xc38f}, |
||||
{0x00d0, 0xc49e}, |
||||
{0x00d1, 0xc391}, |
||||
{0x00d2, 0xc392}, |
||||
{0x00d3, 0xc393}, |
||||
{0x00d4, 0xc394}, |
||||
{0x00d5, 0xc395}, |
||||
{0x00d6, 0xc396}, |
||||
{0x00d7, 0xc397}, |
||||
{0x00d8, 0xc398}, |
||||
{0x00d9, 0xc399}, |
||||
{0x00da, 0xc39a}, |
||||
{0x00db, 0xc39b}, |
||||
{0x00dc, 0xc39c}, |
||||
{0x00dd, 0xc4b0}, |
||||
{0x00de, 0xc59e}, |
||||
{0x00df, 0xc39f}, |
||||
{0x00e0, 0xc3a0}, |
||||
{0x00e1, 0xc3a1}, |
||||
{0x00e2, 0xc3a2}, |
||||
{0x00e3, 0xc3a3}, |
||||
{0x00e4, 0xc3a4}, |
||||
{0x00e5, 0xc3a5}, |
||||
{0x00e6, 0xc3a6}, |
||||
{0x00e7, 0xc3a7}, |
||||
{0x00e8, 0xc3a8}, |
||||
{0x00e9, 0xc3a9}, |
||||
{0x00ea, 0xc3aa}, |
||||
{0x00eb, 0xc3ab}, |
||||
{0x00ec, 0xc3ac}, |
||||
{0x00ed, 0xc3ad}, |
||||
{0x00ee, 0xc3ae}, |
||||
{0x00ef, 0xc3af}, |
||||
{0x00f0, 0xc49f}, |
||||
{0x00f1, 0xc3b1}, |
||||
{0x00f2, 0xc3b2}, |
||||
{0x00f3, 0xc3b3}, |
||||
{0x00f4, 0xc3b4}, |
||||
{0x00f5, 0xc3b5}, |
||||
{0x00f6, 0xc3b6}, |
||||
{0x00f7, 0xc3b7}, |
||||
{0x00f8, 0xc3b8}, |
||||
{0x00f9, 0xc3b9}, |
||||
{0x00fa, 0xc3ba}, |
||||
{0x00fb, 0xc3bb}, |
||||
{0x00fc, 0xc3bc}, |
||||
{0x00fd, 0xc4b1}, |
||||
{0x00fe, 0xc59f}, |
||||
{0x00ff, 0xc3bf} |
||||
}; |
@ -0,0 +1,107 @@ |
||||
static pg_local_to_utf LUmapWIN1255[ 105 ] = { |
||||
{0x0080, 0xe282ac}, |
||||
{0x0082, 0xe2809a}, |
||||
{0x0083, 0xc692}, |
||||
{0x0084, 0xe2809e}, |
||||
{0x0085, 0xe280a6}, |
||||
{0x0086, 0xe280a0}, |
||||
{0x0087, 0xe280a1}, |
||||
{0x0088, 0xcb86}, |
||||
{0x0089, 0xe280b0}, |
||||
{0x008b, 0xe280b9}, |
||||
{0x0091, 0xe28098}, |
||||
{0x0092, 0xe28099}, |
||||
{0x0093, 0xe2809c}, |
||||
{0x0094, 0xe2809d}, |
||||
{0x0095, 0xe280a2}, |
||||
{0x0096, 0xe28093}, |
||||
{0x0097, 0xe28094}, |
||||
{0x0098, 0xcb9c}, |
||||
{0x0099, 0xe284a2}, |
||||
{0x009b, 0xe280ba}, |
||||
{0x00a0, 0xc2a0}, |
||||
{0x00a1, 0xc2a1}, |
||||
{0x00a2, 0xc2a2}, |
||||
{0x00a3, 0xc2a3}, |
||||
{0x00a4, 0xe282aa}, |
||||
{0x00a5, 0xc2a5}, |
||||
{0x00a6, 0xc2a6}, |
||||
{0x00a7, 0xc2a7}, |
||||
{0x00a8, 0xc2a8}, |
||||
{0x00a9, 0xc2a9}, |
||||
{0x00aa, 0xc397}, |
||||
{0x00ab, 0xc2ab}, |
||||
{0x00ac, 0xc2ac}, |
||||
{0x00ad, 0xc2ad}, |
||||
{0x00ae, 0xc2ae}, |
||||
{0x00af, 0xc2af}, |
||||
{0x00b0, 0xc2b0}, |
||||
{0x00b1, 0xc2b1}, |
||||
{0x00b2, 0xc2b2}, |
||||
{0x00b3, 0xc2b3}, |
||||
{0x00b4, 0xc2b4}, |
||||
{0x00b5, 0xc2b5}, |
||||
{0x00b6, 0xc2b6}, |
||||
{0x00b7, 0xc2b7}, |
||||
{0x00b8, 0xc2b8}, |
||||
{0x00b9, 0xc2b9}, |
||||
{0x00ba, 0xc3b7}, |
||||
{0x00bb, 0xc2bb}, |
||||
{0x00bc, 0xc2bc}, |
||||
{0x00bd, 0xc2bd}, |
||||
{0x00be, 0xc2be}, |
||||
{0x00bf, 0xc2bf}, |
||||
{0x00c0, 0xd6b0}, |
||||
{0x00c1, 0xd6b1}, |
||||
{0x00c2, 0xd6b2}, |
||||
{0x00c3, 0xd6b3}, |
||||
{0x00c4, 0xd6b4}, |
||||
{0x00c5, 0xd6b5}, |
||||
{0x00c6, 0xd6b6}, |
||||
{0x00c7, 0xd6b7}, |
||||
{0x00c8, 0xd6b8}, |
||||
{0x00c9, 0xd6b9}, |
||||
{0x00cb, 0xd6bb}, |
||||
{0x00cc, 0xd6bc}, |
||||
{0x00cd, 0xd6bd}, |
||||
{0x00ce, 0xd6be}, |
||||
{0x00cf, 0xd6bf}, |
||||
{0x00d0, 0xd780}, |
||||
{0x00d1, 0xd781}, |
||||
{0x00d2, 0xd782}, |
||||
{0x00d3, 0xd783}, |
||||
{0x00d4, 0xd7b0}, |
||||
{0x00d5, 0xd7b1}, |
||||
{0x00d6, 0xd7b2}, |
||||
{0x00d7, 0xd7b3}, |
||||
{0x00d8, 0xd7b4}, |
||||
{0x00e0, 0xd790}, |
||||
{0x00e1, 0xd791}, |
||||
{0x00e2, 0xd792}, |
||||
{0x00e3, 0xd793}, |
||||
{0x00e4, 0xd794}, |
||||
{0x00e5, 0xd795}, |
||||
{0x00e6, 0xd796}, |
||||
{0x00e7, 0xd797}, |
||||
{0x00e8, 0xd798}, |
||||
{0x00e9, 0xd799}, |
||||
{0x00ea, 0xd79a}, |
||||
{0x00eb, 0xd79b}, |
||||
{0x00ec, 0xd79c}, |
||||
{0x00ed, 0xd79d}, |
||||
{0x00ee, 0xd79e}, |
||||
{0x00ef, 0xd79f}, |
||||
{0x00f0, 0xd7a0}, |
||||
{0x00f1, 0xd7a1}, |
||||
{0x00f2, 0xd7a2}, |
||||
{0x00f3, 0xd7a3}, |
||||
{0x00f4, 0xd7a4}, |
||||
{0x00f5, 0xd7a5}, |
||||
{0x00f6, 0xd7a6}, |
||||
{0x00f7, 0xd7a7}, |
||||
{0x00f8, 0xd7a8}, |
||||
{0x00f9, 0xd7a9}, |
||||
{0x00fa, 0xd7aa}, |
||||
{0x00fd, 0xe2808e}, |
||||
{0x00fe, 0xe2808f} |
||||
}; |
@ -0,0 +1,118 @@ |
||||
static pg_local_to_utf LUmapWIN1257[ 116 ] = { |
||||
{0x0080, 0xe282ac}, |
||||
{0x0082, 0xe2809a}, |
||||
{0x0084, 0xe2809e}, |
||||
{0x0085, 0xe280a6}, |
||||
{0x0086, 0xe280a0}, |
||||
{0x0087, 0xe280a1}, |
||||
{0x0089, 0xe280b0}, |
||||
{0x008b, 0xe280b9}, |
||||
{0x008d, 0xc2a8}, |
||||
{0x008e, 0xcb87}, |
||||
{0x008f, 0xc2b8}, |
||||
{0x0091, 0xe28098}, |
||||
{0x0092, 0xe28099}, |
||||
{0x0093, 0xe2809c}, |
||||
{0x0094, 0xe2809d}, |
||||
{0x0095, 0xe280a2}, |
||||
{0x0096, 0xe28093}, |
||||
{0x0097, 0xe28094}, |
||||
{0x0099, 0xe284a2}, |
||||
{0x009b, 0xe280ba}, |
||||
{0x009d, 0xc2af}, |
||||
{0x009e, 0xcb9b}, |
||||
{0x00a0, 0xc2a0}, |
||||
{0x00a2, 0xc2a2}, |
||||
{0x00a3, 0xc2a3}, |
||||
{0x00a4, 0xc2a4}, |
||||
{0x00a6, 0xc2a6}, |
||||
{0x00a7, 0xc2a7}, |
||||
{0x00a8, 0xc398}, |
||||
{0x00a9, 0xc2a9}, |
||||
{0x00aa, 0xc596}, |
||||
{0x00ab, 0xc2ab}, |
||||
{0x00ac, 0xc2ac}, |
||||
{0x00ad, 0xc2ad}, |
||||
{0x00ae, 0xc2ae}, |
||||
{0x00af, 0xc386}, |
||||
{0x00b0, 0xc2b0}, |
||||
{0x00b1, 0xc2b1}, |
||||
{0x00b2, 0xc2b2}, |
||||
{0x00b3, 0xc2b3}, |
||||
{0x00b4, 0xc2b4}, |
||||
{0x00b5, 0xc2b5}, |
||||
{0x00b6, 0xc2b6}, |
||||
{0x00b7, 0xc2b7}, |
||||
{0x00b8, 0xc3b8}, |
||||
{0x00b9, 0xc2b9}, |
||||
{0x00ba, 0xc597}, |
||||
{0x00bb, 0xc2bb}, |
||||
{0x00bc, 0xc2bc}, |
||||
{0x00bd, 0xc2bd}, |
||||
{0x00be, 0xc2be}, |
||||
{0x00bf, 0xc3a6}, |
||||
{0x00c0, 0xc484}, |
||||
{0x00c1, 0xc4ae}, |
||||
{0x00c2, 0xc480}, |
||||
{0x00c3, 0xc486}, |
||||
{0x00c4, 0xc384}, |
||||
{0x00c5, 0xc385}, |
||||
{0x00c6, 0xc498}, |
||||
{0x00c7, 0xc492}, |
||||
{0x00c8, 0xc48c}, |
||||
{0x00c9, 0xc389}, |
||||
{0x00ca, 0xc5b9}, |
||||
{0x00cb, 0xc496}, |
||||
{0x00cc, 0xc4a2}, |
||||
{0x00cd, 0xc4b6}, |
||||
{0x00ce, 0xc4aa}, |
||||
{0x00cf, 0xc4bb}, |
||||
{0x00d0, 0xc5a0}, |
||||
{0x00d1, 0xc583}, |
||||
{0x00d2, 0xc585}, |
||||
{0x00d3, 0xc393}, |
||||
{0x00d4, 0xc58c}, |
||||
{0x00d5, 0xc395}, |
||||
{0x00d6, 0xc396}, |
||||
{0x00d7, 0xc397}, |
||||
{0x00d8, 0xc5b2}, |
||||
{0x00d9, 0xc581}, |
||||
{0x00da, 0xc59a}, |
||||
{0x00db, 0xc5aa}, |
||||
{0x00dc, 0xc39c}, |
||||
{0x00dd, 0xc5bb}, |
||||
{0x00de, 0xc5bd}, |
||||
{0x00df, 0xc39f}, |
||||
{0x00e0, 0xc485}, |
||||
{0x00e1, 0xc4af}, |
||||
{0x00e2, 0xc481}, |
||||
{0x00e3, 0xc487}, |
||||
{0x00e4, 0xc3a4}, |
||||
{0x00e5, 0xc3a5}, |
||||
{0x00e6, 0xc499}, |
||||
{0x00e7, 0xc493}, |
||||
{0x00e8, 0xc48d}, |
||||
{0x00e9, 0xc3a9}, |
||||
{0x00ea, 0xc5ba}, |
||||
{0x00eb, 0xc497}, |
||||
{0x00ec, 0xc4a3}, |
||||
{0x00ed, 0xc4b7}, |
||||
{0x00ee, 0xc4ab}, |
||||
{0x00ef, 0xc4bc}, |
||||
{0x00f0, 0xc5a1}, |
||||
{0x00f1, 0xc584}, |
||||
{0x00f2, 0xc586}, |
||||
{0x00f3, 0xc3b3}, |
||||
{0x00f4, 0xc58d}, |
||||
{0x00f5, 0xc3b5}, |
||||
{0x00f6, 0xc3b6}, |
||||
{0x00f7, 0xc3b7}, |
||||
{0x00f8, 0xc5b3}, |
||||
{0x00f9, 0xc582}, |
||||
{0x00fa, 0xc59b}, |
||||
{0x00fb, 0xc5ab}, |
||||
{0x00fc, 0xc3bc}, |
||||
{0x00fd, 0xc5bc}, |
||||
{0x00fe, 0xc5be}, |
||||
{0x00ff, 0xcb99} |
||||
}; |
@ -1,12 +1,12 @@ |
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win874/Makefile,v 1.3 2003/11/29 22:40:43 pgsql Exp $
|
||||
# $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win/Makefile,v 1.1 2006/02/18 16:15:22 petere Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
subdir = src/backend/utils/mb/conversion_procs/utf8_and_win874
|
||||
subdir = src/backend/utils/mb/conversion_procs/utf8_and_win
|
||||
top_builddir = ../../../../../..
|
||||
include $(top_builddir)/src/Makefile.global |
||||
|
||||
NAME := utf8_and_win874
|
||||
NAME := utf8_and_win
|
||||
|
||||
include $(srcdir)/../proc.mk |
@ -0,0 +1,156 @@ |
||||
/*-------------------------------------------------------------------------
|
||||
* |
||||
* WIN <--> UTF8 |
||||
* |
||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group |
||||
* Portions Copyright (c) 1994, Regents of the University of California |
||||
* |
||||
* IDENTIFICATION |
||||
* $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win/utf8_and_win.c,v 1.1 2006/02/18 16:15:22 petere Exp $ |
||||
* |
||||
*------------------------------------------------------------------------- |
||||
*/ |
||||
|
||||
#include "postgres.h" |
||||
#include "fmgr.h" |
||||
#include "mb/pg_wchar.h" |
||||
#include "../../Unicode/utf8_to_win866.map" |
||||
#include "../../Unicode/utf8_to_win874.map" |
||||
#include "../../Unicode/utf8_to_win1250.map" |
||||
#include "../../Unicode/utf8_to_win1251.map" |
||||
#include "../../Unicode/utf8_to_win1252.map" |
||||
#include "../../Unicode/utf8_to_win1253.map" |
||||
#include "../../Unicode/utf8_to_win1254.map" |
||||
#include "../../Unicode/utf8_to_win1255.map" |
||||
#include "../../Unicode/utf8_to_win1256.map" |
||||
#include "../../Unicode/utf8_to_win1257.map" |
||||
#include "../../Unicode/utf8_to_win1258.map" |
||||
#include "../../Unicode/win866_to_utf8.map" |
||||
#include "../../Unicode/win874_to_utf8.map" |
||||
#include "../../Unicode/win1250_to_utf8.map" |
||||
#include "../../Unicode/win1251_to_utf8.map" |
||||
#include "../../Unicode/win1252_to_utf8.map" |
||||
#include "../../Unicode/win1253_to_utf8.map" |
||||
#include "../../Unicode/win1254_to_utf8.map" |
||||
#include "../../Unicode/win1255_to_utf8.map" |
||||
#include "../../Unicode/win1256_to_utf8.map" |
||||
#include "../../Unicode/win1257_to_utf8.map" |
||||
#include "../../Unicode/win1258_to_utf8.map" |
||||
|
||||
PG_FUNCTION_INFO_V1(win_to_utf8); |
||||
PG_FUNCTION_INFO_V1(utf8_to_win); |
||||
|
||||
extern Datum win_to_utf8(PG_FUNCTION_ARGS); |
||||
extern Datum utf8_to_win(PG_FUNCTION_ARGS); |
||||
|
||||
/* ----------
|
||||
* conv_proc( |
||||
* INTEGER, -- source encoding id |
||||
* INTEGER, -- destination encoding id |
||||
* CSTRING, -- source string (null terminated C string) |
||||
* CSTRING, -- destination string (null terminated C string) |
||||
* INTEGER -- source string length |
||||
* ) returns VOID; |
||||
* ---------- |
||||
*/ |
||||
|
||||
typedef struct |
||||
{ |
||||
pg_enc encoding; |
||||
pg_local_to_utf *map1; /* to UTF8 map name */ |
||||
pg_utf_to_local *map2; /* from UTF8 map name */ |
||||
int size1; /* size of map1 */ |
||||
int size2; /* size of map2 */ |
||||
} pg_conv_map; |
||||
|
||||
static pg_conv_map maps[] = { |
||||
{PG_WIN866, LUmapWIN866, ULmapWIN866, |
||||
sizeof(LUmapWIN866) / sizeof(pg_local_to_utf), |
||||
sizeof(ULmapWIN866) / sizeof(pg_utf_to_local)}, |
||||
{PG_WIN874, LUmapWIN874, ULmapWIN874, |
||||
sizeof(LUmapWIN874) / sizeof(pg_local_to_utf), |
||||
sizeof(ULmapWIN874) / sizeof(pg_utf_to_local)}, |
||||
{PG_WIN1250, LUmapWIN1250, ULmapWIN1250, |
||||
sizeof(LUmapWIN1250) / sizeof(pg_local_to_utf), |
||||
sizeof(ULmapWIN1250) / sizeof(pg_utf_to_local)}, |
||||
{PG_WIN1251, LUmapWIN1251, ULmapWIN1251, |
||||
sizeof(LUmapWIN1251) / sizeof(pg_local_to_utf), |
||||
sizeof(ULmapWIN1251) / sizeof(pg_utf_to_local)}, |
||||
{PG_WIN1252, LUmapWIN1252, ULmapWIN1252, |
||||
sizeof(LUmapWIN1252) / sizeof(pg_local_to_utf), |
||||
sizeof(ULmapWIN1252) / sizeof(pg_utf_to_local)}, |
||||
{PG_WIN1253, LUmapWIN1253, ULmapWIN1253, |
||||
sizeof(LUmapWIN1253) / sizeof(pg_local_to_utf), |
||||
sizeof(ULmapWIN1253) / sizeof(pg_utf_to_local)}, |
||||
{PG_WIN1254, LUmapWIN1254, ULmapWIN1254, |
||||
sizeof(LUmapWIN1254) / sizeof(pg_local_to_utf), |
||||
sizeof(ULmapWIN1254) / sizeof(pg_utf_to_local)}, |
||||
{PG_WIN1255, LUmapWIN1255, ULmapWIN1255, |
||||
sizeof(LUmapWIN1255) / sizeof(pg_local_to_utf), |
||||
sizeof(ULmapWIN1255) / sizeof(pg_utf_to_local)}, |
||||
{PG_WIN1256, LUmapWIN1256, ULmapWIN1256, |
||||
sizeof(LUmapWIN1256) / sizeof(pg_local_to_utf), |
||||
sizeof(ULmapWIN1256) / sizeof(pg_utf_to_local)}, |
||||
{PG_WIN1257, LUmapWIN1257, ULmapWIN1257, |
||||
sizeof(LUmapWIN1257) / sizeof(pg_local_to_utf), |
||||
sizeof(ULmapWIN1257) / sizeof(pg_utf_to_local)}, |
||||
{PG_WIN1258, LUmapWIN1258, ULmapWIN1258, |
||||
sizeof(LUmapWIN1258) / sizeof(pg_local_to_utf), |
||||
sizeof(ULmapWIN1258) / sizeof(pg_utf_to_local)}, |
||||
}; |
||||
|
||||
Datum |
||||
win_to_utf8(PG_FUNCTION_ARGS) |
||||
{ |
||||
int encoding = PG_GETARG_INT32(0); |
||||
unsigned char *src = (unsigned char *) PG_GETARG_CSTRING(2); |
||||
unsigned char *dest = (unsigned char *) PG_GETARG_CSTRING(3); |
||||
int len = PG_GETARG_INT32(4); |
||||
int i; |
||||
|
||||
Assert(PG_GETARG_INT32(1) == PG_UTF8); |
||||
Assert(len >= 0); |
||||
|
||||
for (i=0;i<sizeof(maps)/sizeof(pg_conv_map);i++) |
||||
{ |
||||
if (encoding == maps[i].encoding) |
||||
{ |
||||
LocalToUtf(src, dest, maps[i].map1, maps[i].size1, encoding, len); |
||||
PG_RETURN_VOID(); |
||||
} |
||||
} |
||||
|
||||
ereport(ERROR, |
||||
(errcode(ERRCODE_INTERNAL_ERROR), |
||||
errmsg("unexpected encoding id %d for WIN charsets", encoding))); |
||||
|
||||
PG_RETURN_VOID(); |
||||
} |
||||
|
||||
Datum |
||||
utf8_to_win(PG_FUNCTION_ARGS) |
||||
{ |
||||
int encoding = PG_GETARG_INT32(1); |
||||
unsigned char *src = (unsigned char *) PG_GETARG_CSTRING(2); |
||||
unsigned char *dest = (unsigned char *) PG_GETARG_CSTRING(3); |
||||
int len = PG_GETARG_INT32(4); |
||||
int i; |
||||
|
||||
Assert(PG_GETARG_INT32(0) == PG_UTF8); |
||||
Assert(len >= 0); |
||||
|
||||
for (i=0;i<sizeof(maps)/sizeof(pg_conv_map);i++) |
||||
{ |
||||
if (encoding == maps[i].encoding) |
||||
{ |
||||
UtfToLocal(src, dest, maps[i].map2, maps[i].size2, len); |
||||
PG_RETURN_VOID(); |
||||
} |
||||
} |
||||
|
||||
ereport(ERROR, |
||||
(errcode(ERRCODE_INTERNAL_ERROR), |
||||
errmsg("unexpected encoding id %d for WIN charsets", encoding))); |
||||
|
||||
PG_RETURN_VOID(); |
||||
} |
@ -1,12 +0,0 @@ |
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win1250/Makefile,v 1.3 2003/11/29 22:40:41 pgsql Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
subdir = src/backend/utils/mb/conversion_procs/utf8_and_win1250
|
||||
top_builddir = ../../../../../..
|
||||
include $(top_builddir)/src/Makefile.global |
||||
|
||||
NAME := utf8_and_win1250
|
||||
|
||||
include $(srcdir)/../proc.mk |
@ -1,69 +0,0 @@ |
||||
/*-------------------------------------------------------------------------
|
||||
* |
||||
* WIN1250 and UTF8 |
||||
* |
||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group |
||||
* Portions Copyright (c) 1994, Regents of the University of California |
||||
* |
||||
* IDENTIFICATION |
||||
* $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win1250/utf8_and_win1250.c,v 1.13 2005/10/15 02:49:35 momjian Exp $ |
||||
* |
||||
*------------------------------------------------------------------------- |
||||
*/ |
||||
|
||||
#include "postgres.h" |
||||
#include "fmgr.h" |
||||
#include "mb/pg_wchar.h" |
||||
#include "../../Unicode/utf8_to_win1250.map" |
||||
#include "../../Unicode/win1250_to_utf8.map" |
||||
|
||||
PG_FUNCTION_INFO_V1(utf8_to_win1250); |
||||
PG_FUNCTION_INFO_V1(win1250_to_utf8); |
||||
|
||||
extern Datum utf8_to_win1250(PG_FUNCTION_ARGS); |
||||
extern Datum win1250_to_utf8(PG_FUNCTION_ARGS); |
||||
|
||||
/* ----------
|
||||
* conv_proc( |
||||
* INTEGER, -- source encoding id |
||||
* INTEGER, -- destination encoding id |
||||
* CSTRING, -- source string (null terminated C string) |
||||
* CSTRING, -- destination string (null terminated C string) |
||||
* INTEGER -- source string length |
||||
* ) returns VOID; |
||||
* ---------- |
||||
*/ |
||||
|
||||
Datum |
||||
utf8_to_win1250(PG_FUNCTION_ARGS) |
||||
{ |
||||
unsigned char *src = (unsigned char *) PG_GETARG_CSTRING(2); |
||||
unsigned char *dest = (unsigned char *) PG_GETARG_CSTRING(3); |
||||
int len = PG_GETARG_INT32(4); |
||||
|
||||
Assert(PG_GETARG_INT32(0) == PG_UTF8); |
||||
Assert(PG_GETARG_INT32(1) == PG_WIN1250); |
||||
Assert(len >= 0); |
||||
|
||||
UtfToLocal(src, dest, ULmapWIN1250, |
||||
sizeof(ULmapWIN1250) / sizeof(pg_utf_to_local), len); |
||||
|
||||
PG_RETURN_VOID(); |
||||
} |
||||
|
||||
Datum |
||||
win1250_to_utf8(PG_FUNCTION_ARGS) |
||||
{ |
||||
unsigned char *src = (unsigned char *) PG_GETARG_CSTRING(2); |
||||
unsigned char *dest = (unsigned char *) PG_GETARG_CSTRING(3); |
||||
int len = PG_GETARG_INT32(4); |
||||
|
||||
Assert(PG_GETARG_INT32(0) == PG_WIN1250); |
||||
Assert(PG_GETARG_INT32(1) == PG_UTF8); |
||||
Assert(len >= 0); |
||||
|
||||
LocalToUtf(src, dest, LUmapWIN1250, |
||||
sizeof(LUmapWIN1250) / sizeof(pg_local_to_utf), PG_WIN1250, len); |
||||
|
||||
PG_RETURN_VOID(); |
||||
} |
@ -1,12 +0,0 @@ |
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win1252/Makefile,v 1.3 2005/03/14 18:31:22 momjian Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
subdir = src/backend/utils/mb/conversion_procs/utf8_and_win1252
|
||||
top_builddir = ../../../../../..
|
||||
include $(top_builddir)/src/Makefile.global |
||||
|
||||
NAME := utf8_and_win1252
|
||||
|
||||
include $(srcdir)/../proc.mk |
@ -1,69 +0,0 @@ |
||||
/*-------------------------------------------------------------------------
|
||||
* |
||||
* WIN1252 and UTF8 |
||||
* |
||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group |
||||
* Portions Copyright (c) 1994, Regents of the University of California |
||||
* |
||||
* IDENTIFICATION |
||||
* $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win1252/utf8_and_win1252.c,v 1.5 2005/10/15 02:49:35 momjian Exp $ |
||||
* |
||||
*------------------------------------------------------------------------- |
||||
*/ |
||||
|
||||
#include "postgres.h" |
||||
#include "fmgr.h" |
||||
#include "mb/pg_wchar.h" |
||||
#include "../../Unicode/utf8_to_win1252.map" |
||||
#include "../../Unicode/win1252_to_utf8.map" |
||||
|
||||
PG_FUNCTION_INFO_V1(utf8_to_win1252); |
||||
PG_FUNCTION_INFO_V1(win1252_to_utf8); |
||||
|
||||
extern Datum utf8_to_win1252(PG_FUNCTION_ARGS); |
||||
extern Datum win1252_to_utf8(PG_FUNCTION_ARGS); |
||||
|
||||
/* ----------
|
||||
* conv_proc( |
||||
* INTEGER, -- source encoding id |
||||
* INTEGER, -- destination encoding id |
||||
* CSTRING, -- source string (null terminated C string) |
||||
* CSTRING, -- destination string (null terminated C string) |
||||
* INTEGER -- source string length |
||||
* ) returns VOID; |
||||
* ---------- |
||||
*/ |
||||
|
||||
Datum |
||||
utf8_to_win1252(PG_FUNCTION_ARGS) |
||||
{ |
||||
unsigned char *src = (unsigned char *) PG_GETARG_CSTRING(2); |
||||
unsigned char *dest = (unsigned char *) PG_GETARG_CSTRING(3); |
||||
int len = PG_GETARG_INT32(4); |
||||
|
||||
Assert(PG_GETARG_INT32(0) == PG_UTF8); |
||||
Assert(PG_GETARG_INT32(1) == PG_WIN1252); |
||||
Assert(len >= 0); |
||||
|
||||
UtfToLocal(src, dest, ULmapWIN1252, |
||||
sizeof(ULmapWIN1252) / sizeof(pg_utf_to_local), len); |
||||
|
||||
PG_RETURN_VOID(); |
||||
} |
||||
|
||||
Datum |
||||
win1252_to_utf8(PG_FUNCTION_ARGS) |
||||
{ |
||||
unsigned char *src = (unsigned char *) PG_GETARG_CSTRING(2); |
||||
unsigned char *dest = (unsigned char *) PG_GETARG_CSTRING(3); |
||||
int len = PG_GETARG_INT32(4); |
||||
|
||||
Assert(PG_GETARG_INT32(0) == PG_WIN1252); |
||||
Assert(PG_GETARG_INT32(1) == PG_UTF8); |
||||
Assert(len >= 0); |
||||
|
||||
LocalToUtf(src, dest, LUmapWIN1252, |
||||
sizeof(LUmapWIN1252) / sizeof(pg_local_to_utf), PG_WIN1252, len); |
||||
|
||||
PG_RETURN_VOID(); |
||||
} |
@ -1,12 +0,0 @@ |
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win1256/Makefile,v 1.3 2003/11/29 22:40:42 pgsql Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
subdir = src/backend/utils/mb/conversion_procs/utf8_and_win1256
|
||||
top_builddir = ../../../../../..
|
||||
include $(top_builddir)/src/Makefile.global |
||||
|
||||
NAME := utf8_and_win1256
|
||||
|
||||
include $(srcdir)/../proc.mk |
@ -1,69 +0,0 @@ |
||||
/*-------------------------------------------------------------------------
|
||||
* |
||||
* WIN1256 and UTF8 |
||||
* |
||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group |
||||
* Portions Copyright (c) 1994, Regents of the University of California |
||||
* |
||||
* IDENTIFICATION |
||||
* $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win1256/utf8_and_win1256.c,v 1.13 2005/10/15 02:49:35 momjian Exp $ |
||||
* |
||||
*------------------------------------------------------------------------- |
||||
*/ |
||||
|
||||
#include "postgres.h" |
||||
#include "fmgr.h" |
||||
#include "mb/pg_wchar.h" |
||||
#include "../../Unicode/utf8_to_win1256.map" |
||||
#include "../../Unicode/win1256_to_utf8.map" |
||||
|
||||
PG_FUNCTION_INFO_V1(utf8_to_win1256); |
||||
PG_FUNCTION_INFO_V1(win1256_to_utf8); |
||||
|
||||
extern Datum utf8_to_win1256(PG_FUNCTION_ARGS); |
||||
extern Datum win1256_to_utf8(PG_FUNCTION_ARGS); |
||||
|
||||
/* ----------
|
||||
* conv_proc( |
||||
* INTEGER, -- source encoding id |
||||
* INTEGER, -- destination encoding id |
||||
* CSTRING, -- source string (null terminated C string) |
||||
* CSTRING, -- destination string (null terminated C string) |
||||
* INTEGER -- source string length |
||||
* ) returns VOID; |
||||
* ---------- |
||||
*/ |
||||
|
||||
Datum |
||||
utf8_to_win1256(PG_FUNCTION_ARGS) |
||||
{ |
||||
unsigned char *src = (unsigned char *) PG_GETARG_CSTRING(2); |
||||
unsigned char *dest = (unsigned char *) PG_GETARG_CSTRING(3); |
||||
int len = PG_GETARG_INT32(4); |
||||
|
||||
Assert(PG_GETARG_INT32(0) == PG_UTF8); |
||||
Assert(PG_GETARG_INT32(1) == PG_WIN1256); |
||||
Assert(len >= 0); |
||||
|
||||
UtfToLocal(src, dest, ULmapWIN1256, |
||||
sizeof(ULmapWIN1256) / sizeof(pg_utf_to_local), len); |
||||
|
||||
PG_RETURN_VOID(); |
||||
} |
||||
|
||||
Datum |
||||
win1256_to_utf8(PG_FUNCTION_ARGS) |
||||
{ |
||||
unsigned char *src = (unsigned char *) PG_GETARG_CSTRING(2); |
||||
unsigned char *dest = (unsigned char *) PG_GETARG_CSTRING(3); |
||||
int len = PG_GETARG_INT32(4); |
||||
|
||||
Assert(PG_GETARG_INT32(0) == PG_WIN1256); |
||||
Assert(PG_GETARG_INT32(1) == PG_UTF8); |
||||
Assert(len >= 0); |
||||
|
||||
LocalToUtf(src, dest, LUmapWIN1256, |
||||
sizeof(LUmapWIN1256) / sizeof(pg_local_to_utf), PG_WIN1256, len); |
||||
|
||||
PG_RETURN_VOID(); |
||||
} |
@ -1,12 +0,0 @@ |
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win1258/Makefile,v 1.2 2005/03/07 23:18:06 neilc Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
subdir = src/backend/utils/mb/conversion_procs/utf8_and_win1258
|
||||
top_builddir = ../../../../../..
|
||||
include $(top_builddir)/src/Makefile.global |
||||
|
||||
NAME := utf8_and_win1258
|
||||
|
||||
include $(srcdir)/../proc.mk |
@ -1,68 +0,0 @@ |
||||
/*-------------------------------------------------------------------------
|
||||
* |
||||
* WIN1258 <--> UTF8 |
||||
* |
||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group |
||||
* Portions Copyright (c) 1994, Regents of the University of California |
||||
* |
||||
* IDENTIFICATION |
||||
* $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win1258/utf8_and_win1258.c,v 1.3 2005/10/15 02:49:35 momjian Exp $ |
||||
* |
||||
*------------------------------------------------------------------------- |
||||
*/ |
||||
|
||||
#include "postgres.h" |
||||
#include "fmgr.h" |
||||
#include "mb/pg_wchar.h" |
||||
#include "../../Unicode/win1258_to_utf8.map" |
||||
#include "../../Unicode/utf8_to_win1258.map" |
||||
|
||||
PG_FUNCTION_INFO_V1(win1258_to_utf8); |
||||
PG_FUNCTION_INFO_V1(utf8_to_win1258); |
||||
|
||||
extern Datum win1258_to_utf8(PG_FUNCTION_ARGS); |
||||
extern Datum utf8_to_win1258(PG_FUNCTION_ARGS); |
||||
|
||||
/* ----------
|
||||
* conv_proc( |
||||
* INTEGER, -- source encoding id |
||||
* INTEGER, -- destination encoding id |
||||
* CSTRING, -- source string (null terminated C string) |
||||
* CSTRING, -- destination string (null terminated C string) |
||||
* INTEGER -- source string length |
||||
* ) returns VOID; |
||||
* ---------- |
||||
*/ |
||||
Datum |
||||
win1258_to_utf8(PG_FUNCTION_ARGS) |
||||
{ |
||||
unsigned char *src = (unsigned char *) PG_GETARG_CSTRING(2); |
||||
unsigned char *dest = (unsigned char *) PG_GETARG_CSTRING(3); |
||||
int len = PG_GETARG_INT32(4); |
||||
|
||||
Assert(PG_GETARG_INT32(0) == PG_WIN1258); |
||||
Assert(PG_GETARG_INT32(1) == PG_UTF8); |
||||
Assert(len >= 0); |
||||
|
||||
LocalToUtf(src, dest, LUmapWIN1258, |
||||
sizeof(LUmapWIN1258) / sizeof(pg_local_to_utf), PG_WIN1258, len); |
||||
|
||||
PG_RETURN_VOID(); |
||||
} |
||||
|
||||
Datum |
||||
utf8_to_win1258(PG_FUNCTION_ARGS) |
||||
{ |
||||
unsigned char *src = (unsigned char *) PG_GETARG_CSTRING(2); |
||||
unsigned char *dest = (unsigned char *) PG_GETARG_CSTRING(3); |
||||
int len = PG_GETARG_INT32(4); |
||||
|
||||
Assert(PG_GETARG_INT32(0) == PG_UTF8); |
||||
Assert(PG_GETARG_INT32(1) == PG_WIN1258); |
||||
Assert(len >= 0); |
||||
|
||||
UtfToLocal(src, dest, ULmapWIN1258, |
||||
sizeof(ULmapWIN1258) / sizeof(pg_utf_to_local), len); |
||||
|
||||
PG_RETURN_VOID(); |
||||
} |
@ -1,69 +0,0 @@ |
||||
/*-------------------------------------------------------------------------
|
||||
* |
||||
* WIN874 and UTF8 |
||||
* |
||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group |
||||
* Portions Copyright (c) 1994, Regents of the University of California |
||||
* |
||||
* IDENTIFICATION |
||||
* $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win874/utf8_and_win874.c,v 1.13 2005/10/15 02:49:35 momjian Exp $ |
||||
* |
||||
*------------------------------------------------------------------------- |
||||
*/ |
||||
|
||||
#include "postgres.h" |
||||
#include "fmgr.h" |
||||
#include "mb/pg_wchar.h" |
||||
#include "../../Unicode/utf8_to_win874.map" |
||||
#include "../../Unicode/win874_to_utf8.map" |
||||
|
||||
PG_FUNCTION_INFO_V1(utf8_to_win874); |
||||
PG_FUNCTION_INFO_V1(win874_to_utf8); |
||||
|
||||
extern Datum utf8_to_win874(PG_FUNCTION_ARGS); |
||||
extern Datum win874_to_utf8(PG_FUNCTION_ARGS); |
||||
|
||||
/* ----------
|
||||
* conv_proc( |
||||
* INTEGER, -- source encoding id |
||||
* INTEGER, -- destination encoding id |
||||
* CSTRING, -- source string (null terminated C string) |
||||
* CSTRING, -- destination string (null terminated C string) |
||||
* INTEGER -- source string length |
||||
* ) returns VOID; |
||||
* ---------- |
||||
*/ |
||||
|
||||
Datum |
||||
utf8_to_win874(PG_FUNCTION_ARGS) |
||||
{ |
||||
unsigned char *src = (unsigned char *) PG_GETARG_CSTRING(2); |
||||
unsigned char *dest = (unsigned char *) PG_GETARG_CSTRING(3); |
||||
int len = PG_GETARG_INT32(4); |
||||
|
||||
Assert(PG_GETARG_INT32(0) == PG_UTF8); |
||||
Assert(PG_GETARG_INT32(1) == PG_WIN874); |
||||
Assert(len >= 0); |
||||
|
||||
UtfToLocal(src, dest, ULmapWIN874, |
||||
sizeof(ULmapWIN874) / sizeof(pg_utf_to_local), len); |
||||
|
||||
PG_RETURN_VOID(); |
||||
} |
||||
|
||||
Datum |
||||
win874_to_utf8(PG_FUNCTION_ARGS) |
||||
{ |
||||
unsigned char *src = (unsigned char *) PG_GETARG_CSTRING(2); |
||||
unsigned char *dest = (unsigned char *) PG_GETARG_CSTRING(3); |
||||
int len = PG_GETARG_INT32(4); |
||||
|
||||
Assert(PG_GETARG_INT32(0) == PG_WIN874); |
||||
Assert(PG_GETARG_INT32(1) == PG_UTF8); |
||||
Assert(len >= 0); |
||||
|
||||
LocalToUtf(src, dest, LUmapWIN874, |
||||
sizeof(LUmapWIN874) / sizeof(pg_local_to_utf), PG_WIN874, len); |
||||
|
||||
PG_RETURN_VOID(); |
||||
} |
Loading…
Reference in new issue