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
420ea688
Commit
420ea688
authored
Apr 24, 2009
by
Magnus Hagander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move gettext encoding names into encnames.c, so we only have one place to update.
Per discussion.
parent
9563afaf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
47 deletions
+60
-47
src/backend/utils/mb/encnames.c
src/backend/utils/mb/encnames.c
+44
-1
src/backend/utils/mb/mbutils.c
src/backend/utils/mb/mbutils.c
+4
-45
src/include/mb/pg_wchar.h
src/include/mb/pg_wchar.h
+12
-1
No files found.
src/backend/utils/mb/encnames.c
View file @
420ea688
...
...
@@ -2,7 +2,7 @@
* Encoding names and routines for work with it. All
* in this file is shared bedween FE and BE.
*
* $PostgreSQL: pgsql/src/backend/utils/mb/encnames.c,v 1.3
8 2009/02/10 19:29:39 petere
Exp $
* $PostgreSQL: pgsql/src/backend/utils/mb/encnames.c,v 1.3
9 2009/04/24 08:43:50 mha
Exp $
*/
#ifdef FRONTEND
#include "postgres_fe.h"
...
...
@@ -430,6 +430,49 @@ pg_enc2name pg_enc2name_tbl[] =
}
};
/* ----------
* These are encoding names for gettext.
* ----------
*/
pg_enc2gettext
pg_enc2gettext_tbl
[]
=
{
{
PG_UTF8
,
"UTF-8"
},
{
PG_LATIN1
,
"LATIN1"
},
{
PG_LATIN2
,
"LATIN2"
},
{
PG_LATIN3
,
"LATIN3"
},
{
PG_LATIN4
,
"LATIN4"
},
{
PG_ISO_8859_5
,
"ISO-8859-5"
},
{
PG_ISO_8859_6
,
"ISO_8859-6"
},
{
PG_ISO_8859_7
,
"ISO-8859-7"
},
{
PG_ISO_8859_8
,
"ISO-8859-8"
},
{
PG_LATIN5
,
"LATIN5"
},
{
PG_LATIN6
,
"LATIN6"
},
{
PG_LATIN7
,
"LATIN7"
},
{
PG_LATIN8
,
"LATIN8"
},
{
PG_LATIN9
,
"LATIN-9"
},
{
PG_LATIN10
,
"LATIN10"
},
{
PG_KOI8R
,
"KOI8-R"
},
{
PG_KOI8U
,
"KOI8-U"
},
{
PG_WIN1250
,
"CP1250"
},
{
PG_WIN1251
,
"CP1251"
},
{
PG_WIN1252
,
"CP1252"
},
{
PG_WIN1253
,
"CP1253"
},
{
PG_WIN1254
,
"CP1254"
},
{
PG_WIN1255
,
"CP1255"
},
{
PG_WIN1256
,
"CP1256"
},
{
PG_WIN1257
,
"CP1257"
},
{
PG_WIN1258
,
"CP1258"
},
{
PG_WIN866
,
"CP866"
},
{
PG_WIN874
,
"CP874"
},
{
PG_EUC_CN
,
"EUC-CN"
},
{
PG_EUC_JP
,
"EUC-JP"
},
{
PG_EUC_KR
,
"EUC-KR"
},
{
PG_EUC_TW
,
"EUC-TW"
},
{
PG_EUC_JIS_2004
,
"EUC-JP"
},
{
0
,
NULL
}
};
/* ----------
* Encoding checks, for error returns -1 else encoding id
* ----------
...
...
src/backend/utils/mb/mbutils.c
View file @
420ea688
...
...
@@ -4,7 +4,7 @@
*
* Tatsuo Ishii
*
* $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.8
5 2009/04/08 09:50:48 heikki
Exp $
* $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.8
6 2009/04/24 08:43:50 mha
Exp $
*/
#include "postgres.h"
...
...
@@ -890,47 +890,6 @@ cliplen(const char *str, int len, int limit)
return
l
;
}
#if defined(ENABLE_NLS)
static
const
struct
codeset_map
{
int
encoding
;
const
char
*
codeset
;
}
codeset_map_array
[]
=
{
{
PG_UTF8
,
"UTF-8"
},
{
PG_LATIN1
,
"LATIN1"
},
{
PG_LATIN2
,
"LATIN2"
},
{
PG_LATIN3
,
"LATIN3"
},
{
PG_LATIN4
,
"LATIN4"
},
{
PG_ISO_8859_5
,
"ISO-8859-5"
},
{
PG_ISO_8859_6
,
"ISO_8859-6"
},
{
PG_ISO_8859_7
,
"ISO-8859-7"
},
{
PG_ISO_8859_8
,
"ISO-8859-8"
},
{
PG_LATIN5
,
"LATIN5"
},
{
PG_LATIN6
,
"LATIN6"
},
{
PG_LATIN7
,
"LATIN7"
},
{
PG_LATIN8
,
"LATIN8"
},
{
PG_LATIN9
,
"LATIN-9"
},
{
PG_LATIN10
,
"LATIN10"
},
{
PG_KOI8R
,
"KOI8-R"
},
{
PG_KOI8U
,
"KOI8-U"
},
{
PG_WIN1250
,
"CP1250"
},
{
PG_WIN1251
,
"CP1251"
},
{
PG_WIN1252
,
"CP1252"
},
{
PG_WIN1253
,
"CP1253"
},
{
PG_WIN1254
,
"CP1254"
},
{
PG_WIN1255
,
"CP1255"
},
{
PG_WIN1256
,
"CP1256"
},
{
PG_WIN1257
,
"CP1257"
},
{
PG_WIN1258
,
"CP1258"
},
{
PG_WIN866
,
"CP866"
},
{
PG_WIN874
,
"CP874"
},
{
PG_EUC_CN
,
"EUC-CN"
},
{
PG_EUC_JP
,
"EUC-JP"
},
{
PG_EUC_KR
,
"EUC-KR"
},
{
PG_EUC_TW
,
"EUC-TW"
},
{
PG_EUC_JIS_2004
,
"EUC-JP"
}
};
#endif
/* ENABLE_NLS */
void
SetDatabaseEncoding
(
int
encoding
)
{
...
...
@@ -969,12 +928,12 @@ pg_bind_textdomain_codeset(const char *domainname)
return
;
#endif
for
(
i
=
0
;
i
<
lengthof
(
codeset_map_array
)
;
i
++
)
for
(
i
=
0
;
pg_enc2gettext_tbl
[
i
].
name
!=
NULL
;
i
++
)
{
if
(
codeset_map_array
[
i
].
encoding
==
encoding
)
if
(
pg_enc2gettext_tbl
[
i
].
encoding
==
encoding
)
{
if
(
bind_textdomain_codeset
(
domainname
,
codeset_map_array
[
i
].
codeset
)
==
NULL
)
pg_enc2gettext_tbl
[
i
].
name
)
==
NULL
)
elog
(
LOG
,
"bind_textdomain_codeset failed"
);
break
;
}
...
...
src/include/mb/pg_wchar.h
View file @
420ea688
...
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/mb/pg_wchar.h,v 1.
89 2009/04/08 09:50:48 heikki
Exp $
* $PostgreSQL: pgsql/src/include/mb/pg_wchar.h,v 1.
90 2009/04/24 08:43:51 mha
Exp $
*
* NOTES
* This is used both by the backend and by libpq, but should not be
...
...
@@ -261,6 +261,17 @@ typedef struct pg_enc2name
extern
pg_enc2name
pg_enc2name_tbl
[];
/*
* Encoding names for gettext
*/
typedef
struct
pg_enc2gettext
{
pg_enc
encoding
;
const
char
*
name
;
}
pg_enc2gettext
;
extern
pg_enc2gettext
pg_enc2gettext_tbl
[];
/*
* pg_wchar stuff
*/
...
...
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