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
0658a6a6
Commit
0658a6a6
authored
Dec 24, 2005
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Formatting cleanup.
parent
804f6b8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
41 deletions
+42
-41
src/backend/utils/mb/wchar.c
src/backend/utils/mb/wchar.c
+42
-41
No files found.
src/backend/utils/mb/wchar.c
View file @
0658a6a6
/*
/*
* conversion functions between pg_wchar and multibyte streams.
* conversion functions between pg_wchar and multibyte streams.
* Tatsuo Ishii
* Tatsuo Ishii
* $PostgreSQL: pgsql/src/backend/utils/mb/wchar.c,v 1.4
8 2005/12/24 09:35:36 ishii
Exp $
* $PostgreSQL: pgsql/src/backend/utils/mb/wchar.c,v 1.4
9 2005/12/24 16:49:48 momjian
Exp $
*
*
* WIN1250 client encoding updated by Pavel Behal
* WIN1250 client encoding updated by Pavel Behal
*
*
...
@@ -28,7 +28,8 @@
...
@@ -28,7 +28,8 @@
/*
/*
* SQL/ASCII
* SQL/ASCII
*/
*/
static
int
pg_ascii2wchar_with_len
static
int
pg_ascii2wchar_with_len
(
const
unsigned
char
*
from
,
pg_wchar
*
to
,
int
len
)
(
const
unsigned
char
*
from
,
pg_wchar
*
to
,
int
len
)
{
{
int
cnt
=
0
;
int
cnt
=
0
;
...
@@ -40,19 +41,19 @@ static int pg_ascii2wchar_with_len
...
@@ -40,19 +41,19 @@ static int pg_ascii2wchar_with_len
cnt
++
;
cnt
++
;
}
}
*
to
=
0
;
*
to
=
0
;
return
(
cnt
)
;
return
cnt
;
}
}
static
int
static
int
pg_ascii_mblen
(
const
unsigned
char
*
s
)
pg_ascii_mblen
(
const
unsigned
char
*
s
)
{
{
return
(
1
)
;
return
1
;
}
}
static
int
static
int
pg_ascii_dsplen
(
const
unsigned
char
*
s
)
pg_ascii_dsplen
(
const
unsigned
char
*
s
)
{
{
return
(
1
)
;
return
1
;
}
}
/*
/*
...
@@ -93,7 +94,7 @@ static int pg_euc2wchar_with_len
...
@@ -93,7 +94,7 @@ static int pg_euc2wchar_with_len
cnt
++
;
cnt
++
;
}
}
*
to
=
0
;
*
to
=
0
;
return
(
cnt
)
;
return
cnt
;
}
}
static
int
static
int
...
@@ -109,7 +110,7 @@ pg_euc_mblen(const unsigned char *s)
...
@@ -109,7 +110,7 @@ pg_euc_mblen(const unsigned char *s)
len
=
2
;
len
=
2
;
else
else
len
=
1
;
len
=
1
;
return
(
len
)
;
return
len
;
}
}
static
int
static
int
...
@@ -125,7 +126,7 @@ pg_euc_dsplen(const unsigned char *s)
...
@@ -125,7 +126,7 @@ pg_euc_dsplen(const unsigned char *s)
len
=
2
;
len
=
2
;
else
else
len
=
1
;
len
=
1
;
return
(
len
)
;
return
len
;
}
}
/*
/*
...
@@ -134,13 +135,13 @@ pg_euc_dsplen(const unsigned char *s)
...
@@ -134,13 +135,13 @@ pg_euc_dsplen(const unsigned char *s)
static
int
pg_eucjp2wchar_with_len
static
int
pg_eucjp2wchar_with_len
(
const
unsigned
char
*
from
,
pg_wchar
*
to
,
int
len
)
(
const
unsigned
char
*
from
,
pg_wchar
*
to
,
int
len
)
{
{
return
(
pg_euc2wchar_with_len
(
from
,
to
,
len
)
);
return
pg_euc2wchar_with_len
(
from
,
to
,
len
);
}
}
static
int
static
int
pg_eucjp_mblen
(
const
unsigned
char
*
s
)
pg_eucjp_mblen
(
const
unsigned
char
*
s
)
{
{
return
(
pg_euc_mblen
(
s
)
);
return
pg_euc_mblen
(
s
);
}
}
static
int
static
int
...
@@ -156,7 +157,7 @@ pg_eucjp_dsplen(const unsigned char *s)
...
@@ -156,7 +157,7 @@ pg_eucjp_dsplen(const unsigned char *s)
len
=
2
;
len
=
2
;
else
else
len
=
1
;
len
=
1
;
return
(
len
)
;
return
len
;
}
}
/*
/*
...
@@ -165,19 +166,19 @@ pg_eucjp_dsplen(const unsigned char *s)
...
@@ -165,19 +166,19 @@ pg_eucjp_dsplen(const unsigned char *s)
static
int
pg_euckr2wchar_with_len
static
int
pg_euckr2wchar_with_len
(
const
unsigned
char
*
from
,
pg_wchar
*
to
,
int
len
)
(
const
unsigned
char
*
from
,
pg_wchar
*
to
,
int
len
)
{
{
return
(
pg_euc2wchar_with_len
(
from
,
to
,
len
)
);
return
pg_euc2wchar_with_len
(
from
,
to
,
len
);
}
}
static
int
static
int
pg_euckr_mblen
(
const
unsigned
char
*
s
)
pg_euckr_mblen
(
const
unsigned
char
*
s
)
{
{
return
(
pg_euc_mblen
(
s
)
);
return
pg_euc_mblen
(
s
);
}
}
static
int
static
int
pg_euckr_dsplen
(
const
unsigned
char
*
s
)
pg_euckr_dsplen
(
const
unsigned
char
*
s
)
{
{
return
(
pg_euc_dsplen
(
s
)
);
return
pg_euc_dsplen
(
s
);
}
}
/*
/*
...
@@ -220,7 +221,7 @@ static int pg_euccn2wchar_with_len
...
@@ -220,7 +221,7 @@ static int pg_euccn2wchar_with_len
cnt
++
;
cnt
++
;
}
}
*
to
=
0
;
*
to
=
0
;
return
(
cnt
)
;
return
cnt
;
}
}
static
int
static
int
...
@@ -232,7 +233,7 @@ pg_euccn_mblen(const unsigned char *s)
...
@@ -232,7 +233,7 @@ pg_euccn_mblen(const unsigned char *s)
len
=
2
;
len
=
2
;
else
else
len
=
1
;
len
=
1
;
return
(
len
)
;
return
len
;
}
}
static
int
static
int
...
@@ -244,7 +245,7 @@ pg_euccn_dsplen(const unsigned char *s)
...
@@ -244,7 +245,7 @@ pg_euccn_dsplen(const unsigned char *s)
len
=
2
;
len
=
2
;
else
else
len
=
1
;
len
=
1
;
return
(
len
)
;
return
len
;
}
}
/*
/*
...
@@ -288,7 +289,7 @@ static int pg_euctw2wchar_with_len
...
@@ -288,7 +289,7 @@ static int pg_euctw2wchar_with_len
cnt
++
;
cnt
++
;
}
}
*
to
=
0
;
*
to
=
0
;
return
(
cnt
)
;
return
cnt
;
}
}
static
int
static
int
...
@@ -304,7 +305,7 @@ pg_euctw_mblen(const unsigned char *s)
...
@@ -304,7 +305,7 @@ pg_euctw_mblen(const unsigned char *s)
len
=
2
;
len
=
2
;
else
else
len
=
1
;
len
=
1
;
return
(
len
)
;
return
len
;
}
}
static
int
static
int
...
@@ -320,7 +321,7 @@ pg_euctw_dsplen(const unsigned char *s)
...
@@ -320,7 +321,7 @@ pg_euctw_dsplen(const unsigned char *s)
len
=
2
;
len
=
2
;
else
else
len
=
1
;
len
=
1
;
return
(
len
)
;
return
len
;
}
}
/*
/*
...
@@ -329,19 +330,19 @@ pg_euctw_dsplen(const unsigned char *s)
...
@@ -329,19 +330,19 @@ pg_euctw_dsplen(const unsigned char *s)
static
int
static
int
pg_johab2wchar_with_len
(
const
unsigned
char
*
from
,
pg_wchar
*
to
,
int
len
)
pg_johab2wchar_with_len
(
const
unsigned
char
*
from
,
pg_wchar
*
to
,
int
len
)
{
{
return
(
pg_euc2wchar_with_len
(
from
,
to
,
len
)
);
return
pg_euc2wchar_with_len
(
from
,
to
,
len
);
}
}
static
int
static
int
pg_johab_mblen
(
const
unsigned
char
*
s
)
pg_johab_mblen
(
const
unsigned
char
*
s
)
{
{
return
(
pg_euc_mblen
(
s
)
);
return
pg_euc_mblen
(
s
);
}
}
static
int
static
int
pg_johab_dsplen
(
const
unsigned
char
*
s
)
pg_johab_dsplen
(
const
unsigned
char
*
s
)
{
{
return
(
pg_euc_dsplen
(
s
)
);
return
pg_euc_dsplen
(
s
);
}
}
/*
/*
...
@@ -392,7 +393,7 @@ pg_utf2wchar_with_len(const unsigned char *from, pg_wchar *to, int len)
...
@@ -392,7 +393,7 @@ pg_utf2wchar_with_len(const unsigned char *from, pg_wchar *to, int len)
cnt
++
;
cnt
++
;
}
}
*
to
=
0
;
*
to
=
0
;
return
(
cnt
)
;
return
cnt
;
}
}
/*
/*
...
@@ -415,7 +416,7 @@ pg_utf_mblen(const unsigned char *s)
...
@@ -415,7 +416,7 @@ pg_utf_mblen(const unsigned char *s)
len
=
5
;
len
=
5
;
else
if
((
*
s
&
0xfe
)
==
0xfc
)
else
if
((
*
s
&
0xfe
)
==
0xfc
)
len
=
6
;
len
=
6
;
return
(
len
)
;
return
len
;
}
}
static
int
static
int
...
@@ -474,7 +475,7 @@ pg_mule2wchar_with_len(const unsigned char *from, pg_wchar *to, int len)
...
@@ -474,7 +475,7 @@ pg_mule2wchar_with_len(const unsigned char *from, pg_wchar *to, int len)
cnt
++
;
cnt
++
;
}
}
*
to
=
0
;
*
to
=
0
;
return
(
cnt
)
;
return
cnt
;
}
}
int
int
...
@@ -494,7 +495,7 @@ pg_mule_mblen(const unsigned char *s)
...
@@ -494,7 +495,7 @@ pg_mule_mblen(const unsigned char *s)
{
/* assume ASCII */
{
/* assume ASCII */
len
=
1
;
len
=
1
;
}
}
return
(
len
)
;
return
len
;
}
}
static
int
static
int
...
@@ -518,19 +519,19 @@ pg_latin12wchar_with_len(const unsigned char *from, pg_wchar *to, int len)
...
@@ -518,19 +519,19 @@ pg_latin12wchar_with_len(const unsigned char *from, pg_wchar *to, int len)
cnt
++
;
cnt
++
;
}
}
*
to
=
0
;
*
to
=
0
;
return
(
cnt
)
;
return
cnt
;
}
}
static
int
static
int
pg_latin1_mblen
(
const
unsigned
char
*
s
)
pg_latin1_mblen
(
const
unsigned
char
*
s
)
{
{
return
(
1
)
;
return
1
;
}
}
static
int
static
int
pg_latin1_dsplen
(
const
unsigned
char
*
s
)
pg_latin1_dsplen
(
const
unsigned
char
*
s
)
{
{
return
(
1
)
;
return
1
;
}
}
/*
/*
...
@@ -553,7 +554,7 @@ pg_sjis_mblen(const unsigned char *s)
...
@@ -553,7 +554,7 @@ pg_sjis_mblen(const unsigned char *s)
{
/* should be ASCII */
{
/* should be ASCII */
len
=
1
;
len
=
1
;
}
}
return
(
len
)
;
return
len
;
}
}
static
int
static
int
...
@@ -573,7 +574,7 @@ pg_sjis_dsplen(const unsigned char *s)
...
@@ -573,7 +574,7 @@ pg_sjis_dsplen(const unsigned char *s)
{
/* should be ASCII */
{
/* should be ASCII */
len
=
1
;
len
=
1
;
}
}
return
(
len
)
;
return
len
;
}
}
/*
/*
...
@@ -592,7 +593,7 @@ pg_big5_mblen(const unsigned char *s)
...
@@ -592,7 +593,7 @@ pg_big5_mblen(const unsigned char *s)
{
/* should be ASCII */
{
/* should be ASCII */
len
=
1
;
len
=
1
;
}
}
return
(
len
)
;
return
len
;
}
}
static
int
static
int
...
@@ -608,7 +609,7 @@ pg_big5_dsplen(const unsigned char *s)
...
@@ -608,7 +609,7 @@ pg_big5_dsplen(const unsigned char *s)
{
/* should be ASCII */
{
/* should be ASCII */
len
=
1
;
len
=
1
;
}
}
return
(
len
)
;
return
len
;
}
}
/*
/*
...
@@ -627,7 +628,7 @@ pg_gbk_mblen(const unsigned char *s)
...
@@ -627,7 +628,7 @@ pg_gbk_mblen(const unsigned char *s)
{
/* should be ASCII */
{
/* should be ASCII */
len
=
1
;
len
=
1
;
}
}
return
(
len
)
;
return
len
;
}
}
static
int
static
int
...
@@ -643,7 +644,7 @@ pg_gbk_dsplen(const unsigned char *s)
...
@@ -643,7 +644,7 @@ pg_gbk_dsplen(const unsigned char *s)
{
/* should be ASCII */
{
/* should be ASCII */
len
=
1
;
len
=
1
;
}
}
return
(
len
)
;
return
len
;
}
}
/*
/*
...
@@ -662,7 +663,7 @@ pg_uhc_mblen(const unsigned char *s)
...
@@ -662,7 +663,7 @@ pg_uhc_mblen(const unsigned char *s)
{
/* should be ASCII */
{
/* should be ASCII */
len
=
1
;
len
=
1
;
}
}
return
(
len
)
;
return
len
;
}
}
static
int
static
int
...
@@ -678,7 +679,7 @@ pg_uhc_dsplen(const unsigned char *s)
...
@@ -678,7 +679,7 @@ pg_uhc_dsplen(const unsigned char *s)
{
/* should be ASCII */
{
/* should be ASCII */
len
=
1
;
len
=
1
;
}
}
return
(
len
)
;
return
len
;
}
}
/*
/*
...
@@ -703,7 +704,7 @@ pg_gb18030_mblen(const unsigned char *s)
...
@@ -703,7 +704,7 @@ pg_gb18030_mblen(const unsigned char *s)
else
else
len
=
2
;
len
=
2
;
}
}
return
(
len
)
;
return
len
;
}
}
static
int
static
int
...
@@ -717,7 +718,7 @@ pg_gb18030_dsplen(const unsigned char *s)
...
@@ -717,7 +718,7 @@ pg_gb18030_dsplen(const unsigned char *s)
}
}
else
else
len
=
2
;
len
=
2
;
return
(
len
)
;
return
len
;
}
}
...
@@ -763,7 +764,7 @@ pg_wchar_tbl pg_wchar_table[] = {
...
@@ -763,7 +764,7 @@ pg_wchar_tbl pg_wchar_table[] = {
int
int
pg_mic_mblen
(
const
unsigned
char
*
mbstr
)
pg_mic_mblen
(
const
unsigned
char
*
mbstr
)
{
{
return
(
pg_mule_mblen
(
mbstr
)
);
return
pg_mule_mblen
(
mbstr
);
}
}
/*
/*
...
...
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