Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
d8a81834
Commit
d8a81834
authored
Dec 24, 2005
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Formatting cleanups.
parent
0658a6a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
64 deletions
+22
-64
src/backend/utils/mb/wchar.c
src/backend/utils/mb/wchar.c
+22
-64
No files found.
src/backend/utils/mb/wchar.c
View file @
d8a81834
/*
* conversion functions between pg_wchar and multibyte streams.
* Tatsuo Ishii
* $PostgreSQL: pgsql/src/backend/utils/mb/wchar.c,v 1.
49 2005/12/24 16:49:48
momjian Exp $
* $PostgreSQL: pgsql/src/backend/utils/mb/wchar.c,v 1.
50 2005/12/24 17:19:40
momjian Exp $
*
* WIN1250 client encoding updated by Pavel Behal
*
...
...
@@ -492,9 +492,7 @@ pg_mule_mblen(const unsigned char *s)
else
if
(
IS_LCPRV2
(
*
s
))
len
=
4
;
else
{
/* assume ASCII */
len
=
1
;
}
len
=
1
;
/* assume ASCII */
return
len
;
}
...
...
@@ -543,17 +541,11 @@ pg_sjis_mblen(const unsigned char *s)
int
len
;
if
(
*
s
>=
0xa1
&&
*
s
<=
0xdf
)
{
/* 1 byte kana? */
len
=
1
;
}
len
=
1
;
/* 1 byte kana? */
else
if
(
*
s
>
0x7f
)
{
/* kanji? */
len
=
2
;
}
len
=
2
;
/* kanji? */
else
{
/* should be ASCII */
len
=
1
;
}
len
=
1
;
/* should be ASCII */
return
len
;
}
...
...
@@ -563,17 +555,11 @@ pg_sjis_dsplen(const unsigned char *s)
int
len
;
if
(
*
s
>=
0xa1
&&
*
s
<=
0xdf
)
{
/* 1 byte kana? */
len
=
1
;
}
len
=
1
;
/* 1 byte kana? */
else
if
(
*
s
>
0x7f
)
{
/* kanji? */
len
=
2
;
}
len
=
2
;
/* kanji? */
else
{
/* should be ASCII */
len
=
1
;
}
len
=
1
;
/* should be ASCII */
return
len
;
}
...
...
@@ -586,13 +572,9 @@ pg_big5_mblen(const unsigned char *s)
int
len
;
if
(
*
s
>
0x7f
)
{
/* kanji? */
len
=
2
;
}
len
=
2
;
/* kanji? */
else
{
/* should be ASCII */
len
=
1
;
}
len
=
1
;
/* should be ASCII */
return
len
;
}
...
...
@@ -602,13 +584,9 @@ pg_big5_dsplen(const unsigned char *s)
int
len
;
if
(
*
s
>
0x7f
)
{
/* kanji? */
len
=
2
;
}
len
=
2
;
/* kanji? */
else
{
/* should be ASCII */
len
=
1
;
}
len
=
1
;
/* should be ASCII */
return
len
;
}
...
...
@@ -621,13 +599,9 @@ pg_gbk_mblen(const unsigned char *s)
int
len
;
if
(
*
s
>
0x7f
)
{
/* kanji? */
len
=
2
;
}
len
=
2
;
/* kanji? */
else
{
/* should be ASCII */
len
=
1
;
}
len
=
1
;
/* should be ASCII */
return
len
;
}
...
...
@@ -637,13 +611,9 @@ pg_gbk_dsplen(const unsigned char *s)
int
len
;
if
(
*
s
>
0x7f
)
{
/* kanji? */
len
=
2
;
}
len
=
2
;
/* kanji? */
else
{
/* should be ASCII */
len
=
1
;
}
len
=
1
;
/* should be ASCII */
return
len
;
}
...
...
@@ -656,13 +626,9 @@ pg_uhc_mblen(const unsigned char *s)
int
len
;
if
(
*
s
>
0x7f
)
{
/* 2byte? */
len
=
2
;
}
len
=
2
;
/* 2byte? */
else
{
/* should be ASCII */
len
=
1
;
}
len
=
1
;
/* should be ASCII */
return
len
;
}
...
...
@@ -672,13 +638,9 @@ pg_uhc_dsplen(const unsigned char *s)
int
len
;
if
(
*
s
>
0x7f
)
{
/* 2byte? */
len
=
2
;
}
len
=
2
;
/* 2byte? */
else
{
/* should be ASCII */
len
=
1
;
}
len
=
1
;
/* should be ASCII */
return
len
;
}
...
...
@@ -692,9 +654,7 @@ pg_gb18030_mblen(const unsigned char *s)
int
len
;
if
(
*
s
<=
0x7f
)
{
/* ASCII */
len
=
1
;
}
len
=
1
;
/* ASCII */
else
{
if
((
*
(
s
+
1
)
>=
0x40
&&
*
(
s
+
1
)
<=
0x7e
)
||
(
*
(
s
+
1
)
>=
0x80
&&
*
(
s
+
1
)
<=
0xfe
))
...
...
@@ -713,9 +673,7 @@ pg_gb18030_dsplen(const unsigned char *s)
int
len
;
if
(
*
s
<=
0x7f
)
{
/* ASCII */
len
=
1
;
}
len
=
1
;
/* ASCII */
else
len
=
2
;
return
len
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment