Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
5735c4cf
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5735c4cf
编写于
2月 23, 2001
作者:
T
Tatsuo Ishii
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Enhanced UTF-8/SJIS mapping generator, contributed by
Eiji Tokuya" <e-tokuya@Mail.Sankyo-Unyu.co.jp>
上级
a9a047e3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
38 addition
and
25 deletion
+38
-25
src/backend/utils/mb/Unicode/UCS_to_SJIS.pl
src/backend/utils/mb/Unicode/UCS_to_SJIS.pl
+38
-25
未找到文件。
src/backend/utils/mb/Unicode/UCS_to_SJIS.pl
浏览文件 @
5735c4cf
...
...
@@ -2,7 +2,7 @@
#
# Copyright 2001 by PostgreSQL Global Development Group
#
# $Id: UCS_to_SJIS.pl,v 1.
1 2000/10/30 10:40:29
ishii Exp $
# $Id: UCS_to_SJIS.pl,v 1.
2 2001/02/23 08:44:33
ishii Exp $
#
# Generate UTF-8 <--> SJIS code conversion tables from
# map files provided by Unicode organization.
...
...
@@ -21,29 +21,45 @@ require "ucs2utf.pl";
# first generate UTF-8 --> SJIS table
$in_file
=
"
SHIFTJIS.TXT
";
$in_file
=
"
CP932.TXT
";
$count
=
0
;
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
>=
0x100
){
$utf
=
&ucs2utf
(
$ucs
);
if
(
$array
{
$utf
}
ne
""
){
printf
STDERR
"
Warning: duplicate unicode: %04x
\n
",
$ucs
;
next
;
}
$count
++
;
$array
{
$utf
}
=
$code
;
}
chop
;
if
(
/^#/
){
next
;
}
(
$c
,
$u
,
$rest
)
=
split
;
$ucs
=
hex
(
$u
);
$code
=
hex
(
$c
);
if
(
$code
>=
0x80
&&
$ucs
>=
0x100
){
$utf
=
&ucs2utf
(
$ucs
);
if
(((
$code
>=
0xed40
)
&&
(
$code
<=
0xeefc
))
||
((
$code
>=
0x8754
)
&&
(
$code
<=
0x875d
))
||
(
$code
==
0x878a
)
||
(
$code
==
0x8782
)
||
(
$code
==
0x8784
)
||
(
$code
==
0xfa5b
)
||
(
$code
==
0xfa54
)
||
((
$code
>=
0x8790
)
&&
(
$code
<=
0x8792
))
||
((
$code
>=
0x8795
)
&&
(
$code
<=
0x8797
))
||
((
$code
>=
0x879a
)
&&
(
$code
<=
0x879c
)))
{
printf
STDERR
"
Warning: duplicate unicode : UCS=0x%04x SJIS=0x%04x
\n
",
$ucs
,
$code
;
next
;
}
$count
++
;
$array
{
$utf
}
=
$code
;
}
}
close
(
FILE
);
#
...
...
@@ -57,7 +73,7 @@ print FILE "static pg_utf_to_local ULmapSJIS[ $count ] = {\n";
for
$index
(
sort
{
$a
<=>
$b
}
keys
(
%array
)
){
$code
=
$array
{
$index
};
$count
--
;
if
(
$count
==
0
){
if
(
$count
==
0
){
printf
FILE
"
{0x%04x, 0x%04x}
\n
",
$index
,
$code
;
}
else
{
printf
FILE
"
{0x%04x, 0x%04x},
\n
",
$index
,
$code
;
...
...
@@ -68,12 +84,13 @@ print FILE "};\n";
close
(
FILE
);
#
# then generate
EUC_JP
--> UTF8 table
# then generate
SJIS
--> UTF8 table
#
open
(
FILE
,
$in_file
)
||
die
(
"
cannot open
$in_file
"
);
reset
'
array
';
$count
=
0
;
while
(
<
FILE
>
){
chop
;
...
...
@@ -85,10 +102,6 @@ while( <FILE> ){
$code
=
hex
(
$c
);
if
(
$code
>=
0x80
&&
$ucs
>=
0x100
){
$utf
=
&ucs2utf
(
$ucs
);
if
(
$array
{
$code
}
ne
""
){
printf
STDERR
"
Warning: duplicate code: %04x
\n
",
$ucs
;
next
;
}
$count
++
;
$array
{
$code
}
=
$utf
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录