From e1f6f9d04498490b7828187c42201b0da853feec Mon Sep 17 00:00:00 2001
From: Mark Dilger <mark.dilger@enterprisedb.com>
Date: Wed, 22 Jan 2020 19:01:16 -0800
Subject: [PATCH 06/11] Relocating pg_wchar.h

Moving pg_wchar.h from src/include/mb to src/include/common.
Updating #include directives as necessary.
---
 contrib/btree_gist/btree_utils_var.h                          | 2 +-
 contrib/dblink/dblink.c                                       | 2 +-
 contrib/fuzzystrmatch/fuzzystrmatch.c                         | 2 +-
 contrib/pg_stat_statements/pg_stat_statements.c               | 2 +-
 contrib/pgcrypto/pgp-pgsql.c                                  | 2 +-
 contrib/postgres_fdw/connection.c                             | 2 +-
 src/backend/access/spgist/spgtextproc.c                       | 2 +-
 src/backend/catalog/genbki.pl                                 | 2 +-
 src/backend/catalog/namespace.c                               | 2 +-
 src/backend/catalog/pg_collation.c                            | 2 +-
 src/backend/catalog/pg_conversion.c                           | 2 +-
 src/backend/catalog/pg_proc.c                                 | 2 +-
 src/backend/commands/collationcmds.c                          | 2 +-
 src/backend/commands/conversioncmds.c                         | 2 +-
 src/backend/commands/copy.c                                   | 2 +-
 src/backend/commands/dbcommands.c                             | 2 +-
 src/backend/commands/extension.c                              | 2 +-
 src/backend/commands/indexcmds.c                              | 2 +-
 src/backend/commands/variable.c                               | 2 +-
 src/backend/executor/execMain.c                               | 2 +-
 src/backend/executor/execPartition.c                          | 2 +-
 src/backend/executor/execUtils.c                              | 2 +-
 src/backend/libpq/pqformat.c                                  | 2 +-
 src/backend/parser/parse_node.c                               | 2 +-
 src/backend/parser/parser.c                                   | 2 +-
 src/backend/parser/scan.l                                     | 2 +-
 src/backend/parser/scansup.c                                  | 2 +-
 src/backend/postmaster/pgstat.c                               | 2 +-
 src/backend/replication/libpqwalreceiver/libpqwalreceiver.c   | 2 +-
 src/backend/replication/logical/logicalfuncs.c                | 2 +-
 src/backend/replication/logical/worker.c                      | 2 +-
 src/backend/tcop/fastpath.c                                   | 2 +-
 src/backend/tcop/postgres.c                                   | 2 +-
 src/backend/utils/adt/ascii.c                                 | 2 +-
 src/backend/utils/adt/format_type.c                           | 2 +-
 src/backend/utils/adt/formatting.c                            | 2 +-
 src/backend/utils/adt/genfile.c                               | 2 +-
 src/backend/utils/adt/jsonapi.c                               | 2 +-
 src/backend/utils/adt/jsonfuncs.c                             | 2 +-
 src/backend/utils/adt/jsonpath_scan.l                         | 2 +-
 src/backend/utils/adt/like.c                                  | 2 +-
 src/backend/utils/adt/like_support.c                          | 2 +-
 src/backend/utils/adt/name.c                                  | 2 +-
 src/backend/utils/adt/oracle_compat.c                         | 2 +-
 src/backend/utils/adt/pg_locale.c                             | 2 +-
 src/backend/utils/adt/ruleutils.c                             | 2 +-
 src/backend/utils/adt/tsvector_op.c                           | 2 +-
 src/backend/utils/adt/varchar.c                               | 2 +-
 src/backend/utils/adt/xml.c                                   | 2 +-
 src/backend/utils/error/elog.c                                | 2 +-
 src/backend/utils/init/miscinit.c                             | 2 +-
 src/backend/utils/init/postinit.c                             | 2 +-
 src/backend/utils/mb/conv.c                                   | 2 +-
 src/backend/utils/mb/conversion_procs/README.euc_jp           | 2 +-
 .../mb/conversion_procs/cyrillic_and_mic/cyrillic_and_mic.c   | 2 +-
 .../mb/conversion_procs/euc2004_sjis2004/euc2004_sjis2004.c   | 2 +-
 .../utils/mb/conversion_procs/euc_cn_and_mic/euc_cn_and_mic.c | 2 +-
 .../mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c     | 2 +-
 .../utils/mb/conversion_procs/euc_kr_and_mic/euc_kr_and_mic.c | 2 +-
 src/backend/utils/mb/conversion_procs/euc_tw_and_big5/big5.c  | 2 +-
 .../mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c     | 2 +-
 .../conversion_procs/latin2_and_win1250/latin2_and_win1250.c  | 2 +-
 .../utils/mb/conversion_procs/latin_and_mic/latin_and_mic.c   | 2 +-
 .../utils/mb/conversion_procs/utf8_and_big5/utf8_and_big5.c   | 2 +-
 .../mb/conversion_procs/utf8_and_cyrillic/utf8_and_cyrillic.c | 2 +-
 .../mb/conversion_procs/utf8_and_euc2004/utf8_and_euc2004.c   | 2 +-
 .../mb/conversion_procs/utf8_and_euc_cn/utf8_and_euc_cn.c     | 2 +-
 .../mb/conversion_procs/utf8_and_euc_jp/utf8_and_euc_jp.c     | 2 +-
 .../mb/conversion_procs/utf8_and_euc_kr/utf8_and_euc_kr.c     | 2 +-
 .../mb/conversion_procs/utf8_and_euc_tw/utf8_and_euc_tw.c     | 2 +-
 .../mb/conversion_procs/utf8_and_gb18030/utf8_and_gb18030.c   | 2 +-
 .../utils/mb/conversion_procs/utf8_and_gbk/utf8_and_gbk.c     | 2 +-
 .../mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c   | 2 +-
 .../conversion_procs/utf8_and_iso8859_1/utf8_and_iso8859_1.c  | 2 +-
 .../utils/mb/conversion_procs/utf8_and_johab/utf8_and_johab.c | 2 +-
 .../utils/mb/conversion_procs/utf8_and_sjis/utf8_and_sjis.c   | 2 +-
 .../mb/conversion_procs/utf8_and_sjis2004/utf8_and_sjis2004.c | 2 +-
 .../utils/mb/conversion_procs/utf8_and_uhc/utf8_and_uhc.c     | 2 +-
 .../utils/mb/conversion_procs/utf8_and_win/utf8_and_win.c     | 2 +-
 src/backend/utils/mb/mbutils.c                                | 2 +-
 src/backend/utils/mb/stringinfo_mb.c                          | 2 +-
 src/backend/utils/mb/wstrcmp.c                                | 2 +-
 src/backend/utils/mb/wstrncmp.c                               | 2 +-
 src/backend/utils/misc/guc-file.l                             | 2 +-
 src/backend/utils/mmgr/mcxt.c                                 | 2 +-
 src/bin/initdb/initdb.c                                       | 2 +-
 src/bin/pg_upgrade/check.c                                    | 2 +-
 src/bin/psql/mainloop.c                                       | 2 +-
 src/common/encnames.c                                         | 4 ++--
 src/common/saslprep.c                                         | 2 +-
 src/common/wchar.c                                            | 4 ++--
 src/include/catalog/pg_conversion.dat                         | 2 +-
 src/include/{mb => common}/pg_wchar.h                         | 2 +-
 src/include/common/unicode_norm.h                             | 2 +-
 src/include/libpq/pqformat.h                                  | 2 +-
 src/include/regex/regcustom.h                                 | 2 +-
 src/include/regex/regex.h                                     | 2 +-
 src/include/tsearch/ts_locale.h                               | 2 +-
 src/interfaces/libpq/fe-connect.c                             | 2 +-
 src/interfaces/libpq/fe-exec.c                                | 2 +-
 src/interfaces/libpq/fe-misc.c                                | 2 +-
 src/interfaces/libpq/fe-protocol3.c                           | 2 +-
 src/pl/plperl/plperl.c                                        | 2 +-
 src/pl/plperl/plperl_helpers.h                                | 2 +-
 src/pl/plpgsql/src/pl_scanner.c                               | 2 +-
 src/pl/plpython/plpy_cursorobject.c                           | 2 +-
 src/pl/plpython/plpy_plpymodule.c                             | 2 +-
 src/pl/plpython/plpy_spi.c                                    | 2 +-
 src/pl/plpython/plpy_typeio.c                                 | 2 +-
 src/pl/plpython/plpy_util.c                                   | 2 +-
 src/pl/tcl/pltcl.c                                            | 2 +-
 src/port/chklocale.c                                          | 2 +-
 112 files changed, 114 insertions(+), 114 deletions(-)
 rename src/include/{mb => common}/pg_wchar.h (99%)

diff --git a/contrib/btree_gist/btree_utils_var.h b/contrib/btree_gist/btree_utils_var.h
index 2f8def655c..4ae273d767 100644
--- a/contrib/btree_gist/btree_utils_var.h
+++ b/contrib/btree_gist/btree_utils_var.h
@@ -6,7 +6,7 @@
 
 #include "access/gist.h"
 #include "btree_gist.h"
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 
 /* Variable length key */
 typedef bytea GBT_VARKEY;
diff --git a/contrib/dblink/dblink.c b/contrib/dblink/dblink.c
index 1dddf02779..a202772fad 100644
--- a/contrib/dblink/dblink.c
+++ b/contrib/dblink/dblink.c
@@ -44,12 +44,12 @@
 #include "catalog/pg_foreign_server.h"
 #include "catalog/pg_type.h"
 #include "catalog/pg_user_mapping.h"
+#include "common/pg_wchar.h"
 #include "executor/spi.h"
 #include "foreign/foreign.h"
 #include "funcapi.h"
 #include "lib/stringinfo.h"
 #include "libpq-fe.h"
-#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "parser/scansup.h"
 #include "utils/acl.h"
diff --git a/contrib/fuzzystrmatch/fuzzystrmatch.c b/contrib/fuzzystrmatch/fuzzystrmatch.c
index ccbb84b481..aa0a209dab 100644
--- a/contrib/fuzzystrmatch/fuzzystrmatch.c
+++ b/contrib/fuzzystrmatch/fuzzystrmatch.c
@@ -40,7 +40,7 @@
 
 #include <ctype.h>
 
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "utils/builtins.h"
 #include "utils/varlena.h"
 
diff --git a/contrib/pg_stat_statements/pg_stat_statements.c b/contrib/pg_stat_statements/pg_stat_statements.c
index 6f82a671ee..53fa917e95 100644
--- a/contrib/pg_stat_statements/pg_stat_statements.c
+++ b/contrib/pg_stat_statements/pg_stat_statements.c
@@ -62,9 +62,9 @@
 #include <unistd.h>
 
 #include "catalog/pg_authid.h"
+#include "common/pg_wchar.h"
 #include "executor/instrument.h"
 #include "funcapi.h"
-#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "parser/analyze.h"
 #include "parser/parsetree.h"
diff --git a/contrib/pgcrypto/pgp-pgsql.c b/contrib/pgcrypto/pgp-pgsql.c
index 8be895df80..960fa1c3e0 100644
--- a/contrib/pgcrypto/pgp-pgsql.c
+++ b/contrib/pgcrypto/pgp-pgsql.c
@@ -32,9 +32,9 @@
 #include "postgres.h"
 
 #include "catalog/pg_type.h"
+#include "common/pg_wchar.h"
 #include "funcapi.h"
 #include "lib/stringinfo.h"
-#include "mb/pg_wchar.h"
 #include "mbuf.h"
 #include "pgp.h"
 #include "px.h"
diff --git a/contrib/postgres_fdw/connection.c b/contrib/postgres_fdw/connection.c
index 29c811a80b..db897e7819 100644
--- a/contrib/postgres_fdw/connection.c
+++ b/contrib/postgres_fdw/connection.c
@@ -16,7 +16,7 @@
 #include "access/xact.h"
 #include "catalog/pg_user_mapping.h"
 #include "commands/defrem.h"
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "miscadmin.h"
 #include "pgstat.h"
 #include "postgres_fdw.h"
diff --git a/src/backend/access/spgist/spgtextproc.c b/src/backend/access/spgist/spgtextproc.c
index b5ec81937c..d166a6352c 100644
--- a/src/backend/access/spgist/spgtextproc.c
+++ b/src/backend/access/spgist/spgtextproc.c
@@ -41,7 +41,7 @@
 
 #include "access/spgist.h"
 #include "catalog/pg_type.h"
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "utils/builtins.h"
 #include "utils/datum.h"
 #include "utils/pg_locale.h"
diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl
index 803251207b..b8c4c22fad 100644
--- a/src/backend/catalog/genbki.pl
+++ b/src/backend/catalog/genbki.pl
@@ -327,7 +327,7 @@ foreach my $row (@{ $catalog_data{pg_type} })
 # as for OIDs, but we have to dig the values out of pg_wchar.h.
 my %encids;
 
-my $encfile = $include_path . 'mb/pg_wchar.h';
+my $encfile = $include_path . 'common/pg_wchar.h';
 open(my $ef, '<', $encfile) || die "$encfile: $!";
 
 # We're parsing an enum, so start with 0 and increment
diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c
index e70243a008..f7fd77ed1a 100644
--- a/src/backend/catalog/namespace.c
+++ b/src/backend/catalog/namespace.c
@@ -40,8 +40,8 @@
 #include "catalog/pg_ts_template.h"
 #include "catalog/pg_type.h"
 #include "commands/dbcommands.h"
+#include "common/pg_wchar.h"
 #include "funcapi.h"
-#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "nodes/makefuncs.h"
 #include "parser/parse_func.h"
diff --git a/src/backend/catalog/pg_collation.c b/src/backend/catalog/pg_collation.c
index 8559779a4f..a5dd02d2ee 100644
--- a/src/backend/catalog/pg_collation.c
+++ b/src/backend/catalog/pg_collation.c
@@ -24,7 +24,7 @@
 #include "catalog/objectaccess.h"
 #include "catalog/pg_collation.h"
 #include "catalog/pg_namespace.h"
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "utils/builtins.h"
 #include "utils/fmgroids.h"
 #include "utils/pg_locale.h"
diff --git a/src/backend/catalog/pg_conversion.c b/src/backend/catalog/pg_conversion.c
index b38df4f696..1163aa709a 100644
--- a/src/backend/catalog/pg_conversion.c
+++ b/src/backend/catalog/pg_conversion.c
@@ -25,7 +25,7 @@
 #include "catalog/pg_conversion.h"
 #include "catalog/pg_namespace.h"
 #include "catalog/pg_proc.h"
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "utils/builtins.h"
 #include "utils/catcache.h"
 #include "utils/fmgroids.h"
diff --git a/src/backend/catalog/pg_proc.c b/src/backend/catalog/pg_proc.c
index 5194dcaac0..d9bb3ebc2a 100644
--- a/src/backend/catalog/pg_proc.c
+++ b/src/backend/catalog/pg_proc.c
@@ -27,9 +27,9 @@
 #include "catalog/pg_transform.h"
 #include "catalog/pg_type.h"
 #include "commands/defrem.h"
+#include "common/pg_wchar.h"
 #include "executor/functions.h"
 #include "funcapi.h"
-#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "nodes/nodeFuncs.h"
 #include "parser/parse_type.h"
diff --git a/src/backend/commands/collationcmds.c b/src/backend/commands/collationcmds.c
index 34c75e8b56..59c0abeea5 100644
--- a/src/backend/commands/collationcmds.c
+++ b/src/backend/commands/collationcmds.c
@@ -27,7 +27,7 @@
 #include "commands/comment.h"
 #include "commands/dbcommands.h"
 #include "commands/defrem.h"
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "miscadmin.h"
 #include "utils/builtins.h"
 #include "utils/lsyscache.h"
diff --git a/src/backend/commands/conversioncmds.c b/src/backend/commands/conversioncmds.c
index f974478b26..87b4cc1090 100644
--- a/src/backend/commands/conversioncmds.c
+++ b/src/backend/commands/conversioncmds.c
@@ -21,7 +21,7 @@
 #include "catalog/pg_type.h"
 #include "commands/alter.h"
 #include "commands/conversioncmds.h"
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "miscadmin.h"
 #include "parser/parse_func.h"
 #include "utils/builtins.h"
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c
index 40a8ec1abd..02cb2d9718 100644
--- a/src/backend/commands/copy.c
+++ b/src/backend/commands/copy.c
@@ -30,6 +30,7 @@
 #include "commands/copy.h"
 #include "commands/defrem.h"
 #include "commands/trigger.h"
+#include "common/pg_wchar.h"
 #include "executor/execPartition.h"
 #include "executor/executor.h"
 #include "executor/nodeModifyTable.h"
@@ -37,7 +38,6 @@
 #include "foreign/fdwapi.h"
 #include "libpq/libpq.h"
 #include "libpq/pqformat.h"
-#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "nodes/makefuncs.h"
 #include "optimizer/optimizer.h"
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index 367c30adb0..0a6e6c6c6b 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -46,7 +46,7 @@
 #include "commands/defrem.h"
 #include "commands/seclabel.h"
 #include "commands/tablespace.h"
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "miscadmin.h"
 #include "pgstat.h"
 #include "postmaster/bgwriter.h"
diff --git a/src/backend/commands/extension.c b/src/backend/commands/extension.c
index 01de398dcb..b17bc69a65 100644
--- a/src/backend/commands/extension.c
+++ b/src/backend/commands/extension.c
@@ -50,8 +50,8 @@
 #include "commands/defrem.h"
 #include "commands/extension.h"
 #include "commands/schemacmds.h"
+#include "common/pg_wchar.h"
 #include "funcapi.h"
-#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "nodes/makefuncs.h"
 #include "storage/fd.h"
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 52ce02f898..e27ead40bd 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -39,7 +39,7 @@
 #include "commands/progress.h"
 #include "commands/tablecmds.h"
 #include "commands/tablespace.h"
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "miscadmin.h"
 #include "nodes/makefuncs.h"
 #include "nodes/nodeFuncs.h"
diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c
index 484f7ea2c0..a197cebb84 100644
--- a/src/backend/commands/variable.c
+++ b/src/backend/commands/variable.c
@@ -24,7 +24,7 @@
 #include "access/xlog.h"
 #include "catalog/pg_authid.h"
 #include "commands/variable.h"
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "miscadmin.h"
 #include "utils/acl.h"
 #include "utils/builtins.h"
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index b03e02ae6c..5275f439c0 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -47,11 +47,11 @@
 #include "catalog/pg_publication.h"
 #include "commands/matview.h"
 #include "commands/trigger.h"
+#include "common/pg_wchar.h"
 #include "executor/execdebug.h"
 #include "executor/nodeSubplan.h"
 #include "foreign/fdwapi.h"
 #include "jit/jit.h"
-#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "parser/parsetree.h"
 #include "storage/bufmgr.h"
diff --git a/src/backend/executor/execPartition.c b/src/backend/executor/execPartition.c
index c13b1d3501..169ff50407 100644
--- a/src/backend/executor/execPartition.c
+++ b/src/backend/executor/execPartition.c
@@ -18,10 +18,10 @@
 #include "catalog/partition.h"
 #include "catalog/pg_inherits.h"
 #include "catalog/pg_type.h"
+#include "common/pg_wchar.h"
 #include "executor/execPartition.h"
 #include "executor/executor.h"
 #include "foreign/fdwapi.h"
-#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "nodes/makefuncs.h"
 #include "partitioning/partbounds.h"
diff --git a/src/backend/executor/execUtils.c b/src/backend/executor/execUtils.c
index cc5177cc2b..673f2db641 100644
--- a/src/backend/executor/execUtils.c
+++ b/src/backend/executor/execUtils.c
@@ -50,9 +50,9 @@
 #include "access/table.h"
 #include "access/tableam.h"
 #include "access/transam.h"
+#include "common/pg_wchar.h"
 #include "executor/executor.h"
 #include "jit/jit.h"
-#include "mb/pg_wchar.h"
 #include "nodes/nodeFuncs.h"
 #include "parser/parsetree.h"
 #include "partitioning/partdesc.h"
diff --git a/src/backend/libpq/pqformat.c b/src/backend/libpq/pqformat.c
index a6f990c2d2..82ee1f26ba 100644
--- a/src/backend/libpq/pqformat.c
+++ b/src/backend/libpq/pqformat.c
@@ -73,9 +73,9 @@
 
 #include <sys/param.h>
 
+#include "common/pg_wchar.h"
 #include "libpq/libpq.h"
 #include "libpq/pqformat.h"
-#include "mb/pg_wchar.h"
 #include "port/pg_bswap.h"
 
 
diff --git a/src/backend/parser/parse_node.c b/src/backend/parser/parse_node.c
index 6e98fe55fc..a075354805 100644
--- a/src/backend/parser/parse_node.c
+++ b/src/backend/parser/parse_node.c
@@ -17,7 +17,7 @@
 #include "access/htup_details.h"
 #include "access/table.h"
 #include "catalog/pg_type.h"
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "nodes/makefuncs.h"
 #include "nodes/nodeFuncs.h"
 #include "parser/parse_coerce.h"
diff --git a/src/backend/parser/parser.c b/src/backend/parser/parser.c
index 1bf1144c4f..0922e9436f 100644
--- a/src/backend/parser/parser.c
+++ b/src/backend/parser/parser.c
@@ -21,7 +21,7 @@
 
 #include "postgres.h"
 
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "parser/gramparse.h"
 #include "parser/parser.h"
 #include "parser/scansup.h"
diff --git a/src/backend/parser/scan.l b/src/backend/parser/scan.l
index 84c73914a8..6bade98a30 100644
--- a/src/backend/parser/scan.l
+++ b/src/backend/parser/scan.l
@@ -35,11 +35,11 @@
 #include <ctype.h>
 #include <unistd.h>
 
+#include "common/pg_wchar.h"
 #include "common/string.h"
 #include "parser/gramparse.h"
 #include "parser/parser.h"		/* only needed for GUC variables */
 #include "parser/scansup.h"
-#include "mb/pg_wchar.h"
 }
 
 %{
diff --git a/src/backend/parser/scansup.c b/src/backend/parser/scansup.c
index 18169ec4f4..ff1e6ab8d5 100644
--- a/src/backend/parser/scansup.c
+++ b/src/backend/parser/scansup.c
@@ -17,7 +17,7 @@
 
 #include <ctype.h>
 
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "parser/scansup.h"
 
 /* ----------------
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index 51c486bebd..7913fa67f0 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -41,9 +41,9 @@
 #include "catalog/pg_database.h"
 #include "catalog/pg_proc.h"
 #include "common/ip.h"
+#include "common/pg_wchar.h"
 #include "libpq/libpq.h"
 #include "libpq/pqsignal.h"
-#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "pg_trace.h"
 #include "pgstat.h"
diff --git a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
index e4fd1f9bb6..c8f8dd178c 100644
--- a/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
+++ b/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
@@ -21,9 +21,9 @@
 
 #include "access/xlog.h"
 #include "catalog/pg_type.h"
+#include "common/pg_wchar.h"
 #include "funcapi.h"
 #include "libpq-fe.h"
-#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "pgstat.h"
 #include "pqexpbuffer.h"
diff --git a/src/backend/replication/logical/logicalfuncs.c b/src/backend/replication/logical/logicalfuncs.c
index 7693c98949..9bd38a936e 100644
--- a/src/backend/replication/logical/logicalfuncs.c
+++ b/src/backend/replication/logical/logicalfuncs.c
@@ -21,9 +21,9 @@
 #include "access/xlog_internal.h"
 #include "access/xlogutils.h"
 #include "catalog/pg_type.h"
+#include "common/pg_wchar.h"
 #include "fmgr.h"
 #include "funcapi.h"
-#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "nodes/makefuncs.h"
 #include "replication/decode.h"
diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c
index 7a5471f95c..a09c8bd092 100644
--- a/src/backend/replication/logical/worker.c
+++ b/src/backend/replication/logical/worker.c
@@ -33,12 +33,12 @@
 #include "catalog/pg_subscription_rel.h"
 #include "commands/tablecmds.h"
 #include "commands/trigger.h"
+#include "common/pg_wchar.h"
 #include "executor/executor.h"
 #include "executor/nodeModifyTable.h"
 #include "funcapi.h"
 #include "libpq/pqformat.h"
 #include "libpq/pqsignal.h"
-#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "nodes/makefuncs.h"
 #include "optimizer/optimizer.h"
diff --git a/src/backend/tcop/fastpath.c b/src/backend/tcop/fastpath.c
index e793984a9f..ef730acc5b 100644
--- a/src/backend/tcop/fastpath.c
+++ b/src/backend/tcop/fastpath.c
@@ -21,9 +21,9 @@
 #include "access/xact.h"
 #include "catalog/objectaccess.h"
 #include "catalog/pg_proc.h"
+#include "common/pg_wchar.h"
 #include "libpq/libpq.h"
 #include "libpq/pqformat.h"
-#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "port/pg_bswap.h"
 #include "tcop/fastpath.h"
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 0a6f80963b..7f03d0acda 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -42,12 +42,12 @@
 #include "catalog/pg_type.h"
 #include "commands/async.h"
 #include "commands/prepare.h"
+#include "common/pg_wchar.h"
 #include "executor/spi.h"
 #include "jit/jit.h"
 #include "libpq/libpq.h"
 #include "libpq/pqformat.h"
 #include "libpq/pqsignal.h"
-#include "mb/pg_wchar.h"
 #include "mb/stringinfo_mb.h"
 #include "miscadmin.h"
 #include "nodes/print.h"
diff --git a/src/backend/utils/adt/ascii.c b/src/backend/utils/adt/ascii.c
index 3aa8a5e7d2..7ac3536705 100644
--- a/src/backend/utils/adt/ascii.c
+++ b/src/backend/utils/adt/ascii.c
@@ -11,7 +11,7 @@
  */
 #include "postgres.h"
 
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "utils/ascii.h"
 #include "utils/builtins.h"
 
diff --git a/src/backend/utils/adt/format_type.c b/src/backend/utils/adt/format_type.c
index 92ee77ac5c..edbded16d5 100644
--- a/src/backend/utils/adt/format_type.c
+++ b/src/backend/utils/adt/format_type.c
@@ -20,7 +20,7 @@
 #include "access/htup_details.h"
 #include "catalog/namespace.h"
 #include "catalog/pg_type.h"
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "utils/builtins.h"
 #include "utils/lsyscache.h"
 #include "utils/numeric.h"
diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c
index ca3c48d024..ff026f410c 100644
--- a/src/backend/utils/adt/formatting.c
+++ b/src/backend/utils/adt/formatting.c
@@ -87,7 +87,7 @@
 
 #include "catalog/pg_collation.h"
 #include "catalog/pg_type.h"
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "parser/scansup.h"
 #include "utils/builtins.h"
 #include "utils/date.h"
 #include "utils/datetime.h"
diff --git a/src/backend/utils/adt/genfile.c b/src/backend/utils/adt/genfile.c
index 0d75928e7f..3da50444ab 100644
--- a/src/backend/utils/adt/genfile.c
+++ b/src/backend/utils/adt/genfile.c
@@ -25,8 +25,8 @@
 #include "catalog/pg_authid.h"
 #include "catalog/pg_tablespace_d.h"
 #include "catalog/pg_type.h"
+#include "common/pg_wchar.h"
 #include "funcapi.h"
-#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "postmaster/syslogger.h"
 #include "storage/fd.h"
diff --git a/src/backend/utils/adt/jsonapi.c b/src/backend/utils/adt/jsonapi.c
index 1ac3b7beda..75e71ba376 100644
--- a/src/backend/utils/adt/jsonapi.c
+++ b/src/backend/utils/adt/jsonapi.c
@@ -13,7 +13,7 @@
  */
 #include "postgres.h"
 
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "miscadmin.h"
 #include "utils/jsonapi.h"
 
diff --git a/src/backend/utils/adt/jsonfuncs.c b/src/backend/utils/adt/jsonfuncs.c
index 66ea11b971..971ef6e630 100644
--- a/src/backend/utils/adt/jsonfuncs.c
+++ b/src/backend/utils/adt/jsonfuncs.c
@@ -18,10 +18,10 @@
 
 #include "access/htup_details.h"
 #include "catalog/pg_type.h"
+#include "common/pg_wchar.h"
 #include "fmgr.h"
 #include "funcapi.h"
 #include "lib/stringinfo.h"
-#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "utils/array.h"
 #include "utils/builtins.h"
diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l
index 70681b789d..bde5539aed 100644
--- a/src/backend/utils/adt/jsonpath_scan.l
+++ b/src/backend/utils/adt/jsonpath_scan.l
@@ -17,7 +17,7 @@
 
 #include "postgres.h"
 
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "nodes/pg_list.h"
 
 static JsonPathString scanstring;
diff --git a/src/backend/utils/adt/like.c b/src/backend/utils/adt/like.c
index 5bf94628c3..1314fce1b4 100644
--- a/src/backend/utils/adt/like.c
+++ b/src/backend/utils/adt/like.c
@@ -20,7 +20,7 @@
 #include <ctype.h>
 
 #include "catalog/pg_collation.h"
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "miscadmin.h"
 #include "utils/builtins.h"
 #include "utils/pg_locale.h"
diff --git a/src/backend/utils/adt/like_support.c b/src/backend/utils/adt/like_support.c
index 286e000d4e..7d20abc9be 100644
--- a/src/backend/utils/adt/like_support.c
+++ b/src/backend/utils/adt/like_support.c
@@ -43,7 +43,7 @@
 #include "catalog/pg_opfamily.h"
 #include "catalog/pg_statistic.h"
 #include "catalog/pg_type.h"
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "nodes/makefuncs.h"
 #include "nodes/nodeFuncs.h"
 #include "nodes/supportnodes.h"
diff --git a/src/backend/utils/adt/name.c b/src/backend/utils/adt/name.c
index 6749e75c89..9e81df701c 100644
--- a/src/backend/utils/adt/name.c
+++ b/src/backend/utils/adt/name.c
@@ -23,8 +23,8 @@
 #include "catalog/namespace.h"
 #include "catalog/pg_collation.h"
 #include "catalog/pg_type.h"
+#include "common/pg_wchar.h"
 #include "libpq/pqformat.h"
-#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "utils/array.h"
 #include "utils/builtins.h"
diff --git a/src/backend/utils/adt/oracle_compat.c b/src/backend/utils/adt/oracle_compat.c
index 0d56dc898a..9c4131e6f2 100644
--- a/src/backend/utils/adt/oracle_compat.c
+++ b/src/backend/utils/adt/oracle_compat.c
@@ -16,7 +16,7 @@
 #include "postgres.h"
 
 #include "common/int.h"
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "utils/builtins.h"
 #include "utils/formatting.h"
 
diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c
index 25fb7e2ebf..5900443039 100644
--- a/src/backend/utils/adt/pg_locale.c
+++ b/src/backend/utils/adt/pg_locale.c
@@ -57,7 +57,7 @@
 #include "access/htup_details.h"
 #include "catalog/pg_collation.h"
 #include "catalog/pg_control.h"
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "utils/builtins.h"
 #include "utils/formatting.h"
 #include "utils/hsearch.h"
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index 116e00bce4..5ae53968f1 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -43,9 +43,9 @@
 #include "commands/defrem.h"
 #include "commands/tablespace.h"
 #include "common/keywords.h"
+#include "common/pg_wchar.h"
 #include "executor/spi.h"
 #include "funcapi.h"
-#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "nodes/makefuncs.h"
 #include "nodes/nodeFuncs.h"
diff --git a/src/backend/utils/adt/tsvector_op.c b/src/backend/utils/adt/tsvector_op.c
index e33ca5abe7..f68d87cb35 100644
--- a/src/backend/utils/adt/tsvector_op.c
+++ b/src/backend/utils/adt/tsvector_op.c
@@ -19,10 +19,10 @@
 #include "catalog/namespace.h"
 #include "catalog/pg_type.h"
 #include "commands/trigger.h"
+#include "common/pg_wchar.h"
 #include "executor/spi.h"
 #include "funcapi.h"
 #include "lib/qunique.h"
-#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "parser/parse_coerce.h"
 #include "tsearch/ts_utils.h"
diff --git a/src/backend/utils/adt/varchar.c b/src/backend/utils/adt/varchar.c
index 1e1239a1ba..69f6d9d8c1 100644
--- a/src/backend/utils/adt/varchar.c
+++ b/src/backend/utils/adt/varchar.c
@@ -17,8 +17,8 @@
 #include "access/detoast.h"
 #include "catalog/pg_collation.h"
 #include "catalog/pg_type.h"
+#include "common/pg_wchar.h"
 #include "libpq/pqformat.h"
-#include "mb/pg_wchar.h"
 #include "nodes/nodeFuncs.h"
 #include "nodes/supportnodes.h"
 #include "utils/array.h"
diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c
index 3808c307f6..74c8a268f2 100644
--- a/src/backend/utils/adt/xml.c
+++ b/src/backend/utils/adt/xml.c
@@ -73,12 +73,12 @@
 #include "catalog/pg_class.h"
 #include "catalog/pg_type.h"
 #include "commands/dbcommands.h"
+#include "common/pg_wchar.h"
 #include "executor/spi.h"
 #include "executor/tablefunc.h"
 #include "fmgr.h"
 #include "lib/stringinfo.h"
 #include "libpq/pqformat.h"
-#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "nodes/execnodes.h"
 #include "nodes/nodeFuncs.h"
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c
index f5b0211f66..61ad9d8f89 100644
--- a/src/backend/utils/error/elog.c
+++ b/src/backend/utils/error/elog.c
@@ -68,9 +68,9 @@
 
 #include "access/transam.h"
 #include "access/xact.h"
+#include "common/pg_wchar.h"
 #include "libpq/libpq.h"
 #include "libpq/pqformat.h"
-#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "postmaster/postmaster.h"
 #include "postmaster/syslogger.h"
diff --git a/src/backend/utils/init/miscinit.c b/src/backend/utils/init/miscinit.c
index c4b2946986..15f79a6d41 100644
--- a/src/backend/utils/init/miscinit.c
+++ b/src/backend/utils/init/miscinit.c
@@ -33,8 +33,8 @@
 #include "access/htup_details.h"
 #include "catalog/pg_authid.h"
 #include "common/file_perm.h"
+#include "common/pg_wchar.h"
 #include "libpq/libpq.h"
-#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "pgstat.h"
 #include "postmaster/autovacuum.h"
diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c
index 8a47dcdcb1..1a9bb9b98d 100644
--- a/src/backend/utils/init/postinit.c
+++ b/src/backend/utils/init/postinit.c
@@ -34,9 +34,9 @@
 #include "catalog/pg_database.h"
 #include "catalog/pg_db_role_setting.h"
 #include "catalog/pg_tablespace.h"
+#include "common/pg_wchar.h"
 #include "libpq/auth.h"
 #include "libpq/libpq-be.h"
-#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "pgstat.h"
 #include "postmaster/autovacuum.h"
diff --git a/src/backend/utils/mb/conv.c b/src/backend/utils/mb/conv.c
index 54dcf71fb7..4b0fc23285 100644
--- a/src/backend/utils/mb/conv.c
+++ b/src/backend/utils/mb/conv.c
@@ -11,7 +11,7 @@
  *-------------------------------------------------------------------------
  */
 #include "postgres.h"
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 
 
 /*
diff --git a/src/backend/utils/mb/conversion_procs/README.euc_jp b/src/backend/utils/mb/conversion_procs/README.euc_jp
index 6e59b7bd7f..97cc63f1bd 100644
--- a/src/backend/utils/mb/conversion_procs/README.euc_jp
+++ b/src/backend/utils/mb/conversion_procs/README.euc_jp
@@ -35,7 +35,7 @@ o C
   ������ʸ�����Ĺ��(5���ܤΰ����ǻ��ꤵ��ޤ���ñ�̤�NULL�����ߥ͡���
   ��ޤޤʤ��Х��ȿ��Ǥ�)�Ȥϰ��פ��ʤ�����Ǥ���
 
-  ���󥳡��ǥ���ID��include/mb/pg_wchar.h��typedef enum pg_enc�����
+  ���󥳡��ǥ���ID��include/common/pg_wchar.h��typedef enum pg_enc�����
   ����Ƥ��ޤ���
 
 o �ؿ�����Ͽ�ȥ���ѥ���
diff --git a/src/backend/utils/mb/conversion_procs/cyrillic_and_mic/cyrillic_and_mic.c b/src/backend/utils/mb/conversion_procs/cyrillic_and_mic/cyrillic_and_mic.c
index 376b48ca61..5500dd4fed 100644
--- a/src/backend/utils/mb/conversion_procs/cyrillic_and_mic/cyrillic_and_mic.c
+++ b/src/backend/utils/mb/conversion_procs/cyrillic_and_mic/cyrillic_and_mic.c
@@ -12,8 +12,8 @@
  */
 
 #include "postgres.h"
+#include "common/pg_wchar.h"
 #include "fmgr.h"
-#include "mb/pg_wchar.h"
 
 PG_MODULE_MAGIC;
 
diff --git a/src/backend/utils/mb/conversion_procs/euc2004_sjis2004/euc2004_sjis2004.c b/src/backend/utils/mb/conversion_procs/euc2004_sjis2004/euc2004_sjis2004.c
index 9ba6bd3040..26051530b7 100644
--- a/src/backend/utils/mb/conversion_procs/euc2004_sjis2004/euc2004_sjis2004.c
+++ b/src/backend/utils/mb/conversion_procs/euc2004_sjis2004/euc2004_sjis2004.c
@@ -11,8 +11,8 @@
  */
 
 #include "postgres.h"
+#include "common/pg_wchar.h"
 #include "fmgr.h"
-#include "mb/pg_wchar.h"
 
 PG_MODULE_MAGIC;
 
diff --git a/src/backend/utils/mb/conversion_procs/euc_cn_and_mic/euc_cn_and_mic.c b/src/backend/utils/mb/conversion_procs/euc_cn_and_mic/euc_cn_and_mic.c
index 59c6c3bb12..d1cb25ea92 100644
--- a/src/backend/utils/mb/conversion_procs/euc_cn_and_mic/euc_cn_and_mic.c
+++ b/src/backend/utils/mb/conversion_procs/euc_cn_and_mic/euc_cn_and_mic.c
@@ -12,8 +12,8 @@
  */
 
 #include "postgres.h"
+#include "common/pg_wchar.h"
 #include "fmgr.h"
-#include "mb/pg_wchar.h"
 
 PG_MODULE_MAGIC;
 
diff --git a/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c b/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c
index 4ca8e2126e..ffc3896c9d 100644
--- a/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c
+++ b/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c
@@ -12,8 +12,8 @@
  */
 
 #include "postgres.h"
+#include "common/pg_wchar.h"
 #include "fmgr.h"
-#include "mb/pg_wchar.h"
 
 /*
  * SJIS alternative code.
diff --git a/src/backend/utils/mb/conversion_procs/euc_kr_and_mic/euc_kr_and_mic.c b/src/backend/utils/mb/conversion_procs/euc_kr_and_mic/euc_kr_and_mic.c
index 4d7876a666..2183cf183a 100644
--- a/src/backend/utils/mb/conversion_procs/euc_kr_and_mic/euc_kr_and_mic.c
+++ b/src/backend/utils/mb/conversion_procs/euc_kr_and_mic/euc_kr_and_mic.c
@@ -12,8 +12,8 @@
  */
 
 #include "postgres.h"
+#include "common/pg_wchar.h"
 #include "fmgr.h"
-#include "mb/pg_wchar.h"
 
 PG_MODULE_MAGIC;
 
diff --git a/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/big5.c b/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/big5.c
index 68f76aa8cb..7601bd65f2 100644
--- a/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/big5.c
+++ b/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/big5.c
@@ -13,7 +13,7 @@
 /* can be used in either frontend or backend */
 #include "postgres_fe.h"
 
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 
 typedef struct
 {
diff --git a/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c b/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c
index 82a22b9beb..e209e9a545 100644
--- a/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c
+++ b/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c
@@ -12,8 +12,8 @@
  */
 
 #include "postgres.h"
+#include "common/pg_wchar.h"
 #include "fmgr.h"
-#include "mb/pg_wchar.h"
 
 #define ENCODING_GROWTH_RATE 4
 
diff --git a/src/backend/utils/mb/conversion_procs/latin2_and_win1250/latin2_and_win1250.c b/src/backend/utils/mb/conversion_procs/latin2_and_win1250/latin2_and_win1250.c
index f424f88145..72ab071d87 100644
--- a/src/backend/utils/mb/conversion_procs/latin2_and_win1250/latin2_and_win1250.c
+++ b/src/backend/utils/mb/conversion_procs/latin2_and_win1250/latin2_and_win1250.c
@@ -12,8 +12,8 @@
  */
 
 #include "postgres.h"
+#include "common/pg_wchar.h"
 #include "fmgr.h"
-#include "mb/pg_wchar.h"
 
 PG_MODULE_MAGIC;
 
diff --git a/src/backend/utils/mb/conversion_procs/latin_and_mic/latin_and_mic.c b/src/backend/utils/mb/conversion_procs/latin_and_mic/latin_and_mic.c
index a358a707c1..5868b66715 100644
--- a/src/backend/utils/mb/conversion_procs/latin_and_mic/latin_and_mic.c
+++ b/src/backend/utils/mb/conversion_procs/latin_and_mic/latin_and_mic.c
@@ -12,8 +12,8 @@
  */
 
 #include "postgres.h"
+#include "common/pg_wchar.h"
 #include "fmgr.h"
-#include "mb/pg_wchar.h"
 
 PG_MODULE_MAGIC;
 
diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_big5/utf8_and_big5.c b/src/backend/utils/mb/conversion_procs/utf8_and_big5/utf8_and_big5.c
index 75ed49ac54..542e055ea2 100644
--- a/src/backend/utils/mb/conversion_procs/utf8_and_big5/utf8_and_big5.c
+++ b/src/backend/utils/mb/conversion_procs/utf8_and_big5/utf8_and_big5.c
@@ -12,8 +12,8 @@
  */
 
 #include "postgres.h"
+#include "common/pg_wchar.h"
 #include "fmgr.h"
-#include "mb/pg_wchar.h"
 #include "../../Unicode/big5_to_utf8.map"
 #include "../../Unicode/utf8_to_big5.map"
 
diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_cyrillic/utf8_and_cyrillic.c b/src/backend/utils/mb/conversion_procs/utf8_and_cyrillic/utf8_and_cyrillic.c
index 90ad316111..d145da093f 100644
--- a/src/backend/utils/mb/conversion_procs/utf8_and_cyrillic/utf8_and_cyrillic.c
+++ b/src/backend/utils/mb/conversion_procs/utf8_and_cyrillic/utf8_and_cyrillic.c
@@ -12,8 +12,8 @@
  */
 
 #include "postgres.h"
+#include "common/pg_wchar.h"
 #include "fmgr.h"
-#include "mb/pg_wchar.h"
 #include "../../Unicode/utf8_to_koi8r.map"
 #include "../../Unicode/koi8r_to_utf8.map"
 #include "../../Unicode/utf8_to_koi8u.map"
diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_euc2004/utf8_and_euc2004.c b/src/backend/utils/mb/conversion_procs/utf8_and_euc2004/utf8_and_euc2004.c
index 018312489c..8d56d2343c 100644
--- a/src/backend/utils/mb/conversion_procs/utf8_and_euc2004/utf8_and_euc2004.c
+++ b/src/backend/utils/mb/conversion_procs/utf8_and_euc2004/utf8_and_euc2004.c
@@ -12,8 +12,8 @@
  */
 
 #include "postgres.h"
+#include "common/pg_wchar.h"
 #include "fmgr.h"
-#include "mb/pg_wchar.h"
 #include "../../Unicode/euc_jis_2004_to_utf8.map"
 #include "../../Unicode/utf8_to_euc_jis_2004.map"
 
diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_euc_cn/utf8_and_euc_cn.c b/src/backend/utils/mb/conversion_procs/utf8_and_euc_cn/utf8_and_euc_cn.c
index 62182a9ba8..41f2f9a5ca 100644
--- a/src/backend/utils/mb/conversion_procs/utf8_and_euc_cn/utf8_and_euc_cn.c
+++ b/src/backend/utils/mb/conversion_procs/utf8_and_euc_cn/utf8_and_euc_cn.c
@@ -12,8 +12,8 @@
  */
 
 #include "postgres.h"
+#include "common/pg_wchar.h"
 #include "fmgr.h"
-#include "mb/pg_wchar.h"
 #include "../../Unicode/euc_cn_to_utf8.map"
 #include "../../Unicode/utf8_to_euc_cn.map"
 
diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_euc_jp/utf8_and_euc_jp.c b/src/backend/utils/mb/conversion_procs/utf8_and_euc_jp/utf8_and_euc_jp.c
index dc5abb5dfd..5a9f8ecfd4 100644
--- a/src/backend/utils/mb/conversion_procs/utf8_and_euc_jp/utf8_and_euc_jp.c
+++ b/src/backend/utils/mb/conversion_procs/utf8_and_euc_jp/utf8_and_euc_jp.c
@@ -12,8 +12,8 @@
  */
 
 #include "postgres.h"
+#include "common/pg_wchar.h"
 #include "fmgr.h"
-#include "mb/pg_wchar.h"
 #include "../../Unicode/euc_jp_to_utf8.map"
 #include "../../Unicode/utf8_to_euc_jp.map"
 
diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_euc_kr/utf8_and_euc_kr.c b/src/backend/utils/mb/conversion_procs/utf8_and_euc_kr/utf8_and_euc_kr.c
index 088a38d839..d09f9dc78a 100644
--- a/src/backend/utils/mb/conversion_procs/utf8_and_euc_kr/utf8_and_euc_kr.c
+++ b/src/backend/utils/mb/conversion_procs/utf8_and_euc_kr/utf8_and_euc_kr.c
@@ -12,8 +12,8 @@
  */
 
 #include "postgres.h"
+#include "common/pg_wchar.h"
 #include "fmgr.h"
-#include "mb/pg_wchar.h"
 #include "../../Unicode/euc_kr_to_utf8.map"
 #include "../../Unicode/utf8_to_euc_kr.map"
 
diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_euc_tw/utf8_and_euc_tw.c b/src/backend/utils/mb/conversion_procs/utf8_and_euc_tw/utf8_and_euc_tw.c
index a9fe94f88b..8e0250e603 100644
--- a/src/backend/utils/mb/conversion_procs/utf8_and_euc_tw/utf8_and_euc_tw.c
+++ b/src/backend/utils/mb/conversion_procs/utf8_and_euc_tw/utf8_and_euc_tw.c
@@ -12,8 +12,8 @@
  */
 
 #include "postgres.h"
+#include "common/pg_wchar.h"
 #include "fmgr.h"
-#include "mb/pg_wchar.h"
 #include "../../Unicode/euc_tw_to_utf8.map"
 #include "../../Unicode/utf8_to_euc_tw.map"
 
diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_gb18030/utf8_and_gb18030.c b/src/backend/utils/mb/conversion_procs/utf8_and_gb18030/utf8_and_gb18030.c
index 96909b5885..6b5b326c6f 100644
--- a/src/backend/utils/mb/conversion_procs/utf8_and_gb18030/utf8_and_gb18030.c
+++ b/src/backend/utils/mb/conversion_procs/utf8_and_gb18030/utf8_and_gb18030.c
@@ -12,8 +12,8 @@
  */
 
 #include "postgres.h"
+#include "common/pg_wchar.h"
 #include "fmgr.h"
-#include "mb/pg_wchar.h"
 #include "../../Unicode/gb18030_to_utf8.map"
 #include "../../Unicode/utf8_to_gb18030.map"
 
diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_gbk/utf8_and_gbk.c b/src/backend/utils/mb/conversion_procs/utf8_and_gbk/utf8_and_gbk.c
index 78bbcd3ce7..4e2246da7a 100644
--- a/src/backend/utils/mb/conversion_procs/utf8_and_gbk/utf8_and_gbk.c
+++ b/src/backend/utils/mb/conversion_procs/utf8_and_gbk/utf8_and_gbk.c
@@ -12,8 +12,8 @@
  */
 
 #include "postgres.h"
+#include "common/pg_wchar.h"
 #include "fmgr.h"
-#include "mb/pg_wchar.h"
 #include "../../Unicode/gbk_to_utf8.map"
 #include "../../Unicode/utf8_to_gbk.map"
 
diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c b/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c
index 348524f4a2..8051eefed9 100644
--- a/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c
+++ b/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c
@@ -12,8 +12,8 @@
  */
 
 #include "postgres.h"
+#include "common/pg_wchar.h"
 #include "fmgr.h"
-#include "mb/pg_wchar.h"
 #include "../../Unicode/iso8859_10_to_utf8.map"
 #include "../../Unicode/iso8859_13_to_utf8.map"
 #include "../../Unicode/iso8859_14_to_utf8.map"
diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_iso8859_1/utf8_and_iso8859_1.c b/src/backend/utils/mb/conversion_procs/utf8_and_iso8859_1/utf8_and_iso8859_1.c
index 2cdca9f780..b9e127cc5e 100644
--- a/src/backend/utils/mb/conversion_procs/utf8_and_iso8859_1/utf8_and_iso8859_1.c
+++ b/src/backend/utils/mb/conversion_procs/utf8_and_iso8859_1/utf8_and_iso8859_1.c
@@ -12,8 +12,8 @@
  */
 
 #include "postgres.h"
+#include "common/pg_wchar.h"
 #include "fmgr.h"
-#include "mb/pg_wchar.h"
 
 PG_MODULE_MAGIC;
 
diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_johab/utf8_and_johab.c b/src/backend/utils/mb/conversion_procs/utf8_and_johab/utf8_and_johab.c
index e09a7c8e41..bece993e1d 100644
--- a/src/backend/utils/mb/conversion_procs/utf8_and_johab/utf8_and_johab.c
+++ b/src/backend/utils/mb/conversion_procs/utf8_and_johab/utf8_and_johab.c
@@ -12,8 +12,8 @@
  */
 
 #include "postgres.h"
+#include "common/pg_wchar.h"
 #include "fmgr.h"
-#include "mb/pg_wchar.h"
 #include "../../Unicode/johab_to_utf8.map"
 #include "../../Unicode/utf8_to_johab.map"
 
diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_sjis/utf8_and_sjis.c b/src/backend/utils/mb/conversion_procs/utf8_and_sjis/utf8_and_sjis.c
index c56fa80a4b..8307d4ceb4 100644
--- a/src/backend/utils/mb/conversion_procs/utf8_and_sjis/utf8_and_sjis.c
+++ b/src/backend/utils/mb/conversion_procs/utf8_and_sjis/utf8_and_sjis.c
@@ -12,8 +12,8 @@
  */
 
 #include "postgres.h"
+#include "common/pg_wchar.h"
 #include "fmgr.h"
-#include "mb/pg_wchar.h"
 #include "../../Unicode/sjis_to_utf8.map"
 #include "../../Unicode/utf8_to_sjis.map"
 
diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_sjis2004/utf8_and_sjis2004.c b/src/backend/utils/mb/conversion_procs/utf8_and_sjis2004/utf8_and_sjis2004.c
index 458500998d..c913ba0866 100644
--- a/src/backend/utils/mb/conversion_procs/utf8_and_sjis2004/utf8_and_sjis2004.c
+++ b/src/backend/utils/mb/conversion_procs/utf8_and_sjis2004/utf8_and_sjis2004.c
@@ -12,8 +12,8 @@
  */
 
 #include "postgres.h"
+#include "common/pg_wchar.h"
 #include "fmgr.h"
-#include "mb/pg_wchar.h"
 #include "../../Unicode/shift_jis_2004_to_utf8.map"
 #include "../../Unicode/utf8_to_shift_jis_2004.map"
 
diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_uhc/utf8_and_uhc.c b/src/backend/utils/mb/conversion_procs/utf8_and_uhc/utf8_and_uhc.c
index 3226ed0325..87ae61ee85 100644
--- a/src/backend/utils/mb/conversion_procs/utf8_and_uhc/utf8_and_uhc.c
+++ b/src/backend/utils/mb/conversion_procs/utf8_and_uhc/utf8_and_uhc.c
@@ -12,8 +12,8 @@
  */
 
 #include "postgres.h"
+#include "common/pg_wchar.h"
 #include "fmgr.h"
-#include "mb/pg_wchar.h"
 #include "../../Unicode/uhc_to_utf8.map"
 #include "../../Unicode/utf8_to_uhc.map"
 
diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_win/utf8_and_win.c b/src/backend/utils/mb/conversion_procs/utf8_and_win/utf8_and_win.c
index 1a0074d063..200fd7f23a 100644
--- a/src/backend/utils/mb/conversion_procs/utf8_and_win/utf8_and_win.c
+++ b/src/backend/utils/mb/conversion_procs/utf8_and_win/utf8_and_win.c
@@ -12,8 +12,8 @@
  */
 
 #include "postgres.h"
+#include "common/pg_wchar.h"
 #include "fmgr.h"
-#include "mb/pg_wchar.h"
 #include "../../Unicode/utf8_to_win1250.map"
 #include "../../Unicode/utf8_to_win1251.map"
 #include "../../Unicode/utf8_to_win1252.map"
diff --git a/src/backend/utils/mb/mbutils.c b/src/backend/utils/mb/mbutils.c
index 86787bcb31..4cec7ec73a 100644
--- a/src/backend/utils/mb/mbutils.c
+++ b/src/backend/utils/mb/mbutils.c
@@ -36,7 +36,7 @@
 
 #include "access/xact.h"
 #include "catalog/namespace.h"
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "utils/builtins.h"
 #include "utils/memutils.h"
 #include "utils/syscache.h"
diff --git a/src/backend/utils/mb/stringinfo_mb.c b/src/backend/utils/mb/stringinfo_mb.c
index c153b77007..e7462a09b5 100644
--- a/src/backend/utils/mb/stringinfo_mb.c
+++ b/src/backend/utils/mb/stringinfo_mb.c
@@ -19,8 +19,8 @@
  */
 #include "postgres.h"
 
+#include "common/pg_wchar.h"
 #include "mb/stringinfo_mb.h"
-#include "mb/pg_wchar.h"
 
 
 /*
diff --git a/src/backend/utils/mb/wstrcmp.c b/src/backend/utils/mb/wstrcmp.c
index dad3ae023a..e5f57d717d 100644
--- a/src/backend/utils/mb/wstrcmp.c
+++ b/src/backend/utils/mb/wstrcmp.c
@@ -35,7 +35,7 @@
 /* can be used in either frontend or backend */
 #include "postgres_fe.h"
 
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 
 int
 pg_char_and_wchar_strcmp(const char *s1, const pg_wchar *s2)
diff --git a/src/backend/utils/mb/wstrncmp.c b/src/backend/utils/mb/wstrncmp.c
index ea4823fc6f..cce0c6c5cf 100644
--- a/src/backend/utils/mb/wstrncmp.c
+++ b/src/backend/utils/mb/wstrncmp.c
@@ -34,7 +34,7 @@
 /* can be used in either frontend or backend */
 #include "postgres_fe.h"
 
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 
 int
 pg_wchar_strncmp(const pg_wchar *s1, const pg_wchar *s2, size_t n)
diff --git a/src/backend/utils/misc/guc-file.l b/src/backend/utils/misc/guc-file.l
index 268b745528..6c9e60ef64 100644
--- a/src/backend/utils/misc/guc-file.l
+++ b/src/backend/utils/misc/guc-file.l
@@ -14,7 +14,7 @@
 #include <ctype.h>
 #include <unistd.h>
 
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "miscadmin.h"
 #include "storage/fd.h"
 #include "utils/guc.h"
diff --git a/src/backend/utils/mmgr/mcxt.c b/src/backend/utils/mmgr/mcxt.c
index 9e24fec72d..71701de091 100644
--- a/src/backend/utils/mmgr/mcxt.c
+++ b/src/backend/utils/mmgr/mcxt.c
@@ -21,7 +21,7 @@
 
 #include "postgres.h"
 
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "miscadmin.h"
 #include "utils/memdebug.h"
 #include "utils/memutils.h"
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index 7f1534aebb..0f1758d8e4 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -66,12 +66,12 @@
 #include "common/file_perm.h"
 #include "common/file_utils.h"
 #include "common/logging.h"
+#include "common/pg_wchar.h"
 #include "common/restricted_token.h"
 #include "common/username.h"
 #include "fe_utils/string_utils.h"
 #include "getaddrinfo.h"
 #include "getopt_long.h"
-#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 
 
diff --git a/src/bin/pg_upgrade/check.c b/src/bin/pg_upgrade/check.c
index 5f9a102a74..faad97fb8b 100644
--- a/src/bin/pg_upgrade/check.c
+++ b/src/bin/pg_upgrade/check.c
@@ -10,8 +10,8 @@
 #include "postgres_fe.h"
 
 #include "catalog/pg_authid_d.h"
+#include "common/pg_wchar.h"
 #include "fe_utils/string_utils.h"
-#include "mb/pg_wchar.h"
 #include "pg_upgrade.h"
 
 static void check_new_cluster_is_empty(void);
diff --git a/src/bin/psql/mainloop.c b/src/bin/psql/mainloop.c
index bdf803a053..3ea44e0f78 100644
--- a/src/bin/psql/mainloop.c
+++ b/src/bin/psql/mainloop.c
@@ -10,9 +10,9 @@
 #include "command.h"
 #include "common.h"
 #include "common/logging.h"
+#include "common/pg_wchar.h"
 #include "input.h"
 #include "mainloop.h"
-#include "mb/pg_wchar.h"
 #include "prompt.h"
 #include "settings.h"
 
diff --git a/src/common/encnames.c b/src/common/encnames.c
index 14cf1b39e9..f06221e1d5 100644
--- a/src/common/encnames.c
+++ b/src/common/encnames.c
@@ -15,7 +15,7 @@
 #include <ctype.h>
 #include <unistd.h>
 
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 
 
 /* ----------
@@ -297,7 +297,7 @@ static const pg_encname pg_encname_tbl[] =
 
 /* ----------
  * These are "official" encoding names.
- * XXX must be sorted by the same order as enum pg_enc (in mb/pg_wchar.h)
+ * XXX must be sorted by the same order as enum pg_enc (in common/pg_wchar.h)
  * ----------
  */
 #ifndef WIN32
diff --git a/src/common/saslprep.c b/src/common/saslprep.c
index 7739b81807..ac49f32eab 100644
--- a/src/common/saslprep.c
+++ b/src/common/saslprep.c
@@ -25,9 +25,9 @@
 #include "postgres_fe.h"
 #endif
 
+#include "common/pg_wchar.h"
 #include "common/saslprep.h"
 #include "common/unicode_norm.h"
-#include "mb/pg_wchar.h"
 
 /*
  * Limit on how large password's we will try to process.  A password
diff --git a/src/common/wchar.c b/src/common/wchar.c
index efaf1c155b..53006115d2 100644
--- a/src/common/wchar.c
+++ b/src/common/wchar.c
@@ -12,7 +12,7 @@
  */
 #include "c.h"
 
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 
 
 /*
@@ -1499,7 +1499,7 @@ pg_utf8_islegal(const unsigned char *source, int length)
 /*
  *-------------------------------------------------------------------
  * encoding info table
- * XXX must be sorted by the same order as enum pg_enc (in mb/pg_wchar.h)
+ * XXX must be sorted by the same order as enum pg_enc (in common/pg_wchar.h)
  *-------------------------------------------------------------------
  */
 const pg_wchar_tbl pg_wchar_table[] = {
diff --git a/src/include/catalog/pg_conversion.dat b/src/include/catalog/pg_conversion.dat
index d7120f2fb0..9913d2e370 100644
--- a/src/include/catalog/pg_conversion.dat
+++ b/src/include/catalog/pg_conversion.dat
@@ -11,7 +11,7 @@
 #----------------------------------------------------------------------
 
 # Note: conforencoding and contoencoding must match the spelling of
-# the labels used in the enum pg_enc in mb/pg_wchar.h.
+# the labels used in the enum pg_enc in common/pg_wchar.h.
 
 [
 
diff --git a/src/include/mb/pg_wchar.h b/src/include/common/pg_wchar.h
similarity index 99%
rename from src/include/mb/pg_wchar.h
rename to src/include/common/pg_wchar.h
index b8892ef730..a1b3a27b9f 100644
--- a/src/include/mb/pg_wchar.h
+++ b/src/include/common/pg_wchar.h
@@ -6,7 +6,7 @@
  * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * src/include/mb/pg_wchar.h
+ * src/include/common/pg_wchar.h
  *
  *	NOTES
  *		This is used both by the backend and by frontends, but should not be
diff --git a/src/include/common/unicode_norm.h b/src/include/common/unicode_norm.h
index f1b7ef1aa4..e09c1162eb 100644
--- a/src/include/common/unicode_norm.h
+++ b/src/include/common/unicode_norm.h
@@ -14,7 +14,7 @@
 #ifndef UNICODE_NORM_H
 #define UNICODE_NORM_H
 
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 
 extern pg_wchar *unicode_normalize_kc(const pg_wchar *input);
 
diff --git a/src/include/libpq/pqformat.h b/src/include/libpq/pqformat.h
index af31e9caba..daeba6d5c9 100644
--- a/src/include/libpq/pqformat.h
+++ b/src/include/libpq/pqformat.h
@@ -13,8 +13,8 @@
 #ifndef PQFORMAT_H
 #define PQFORMAT_H
 
+#include "common/pg_wchar.h"
 #include "lib/stringinfo.h"
-#include "mb/pg_wchar.h"
 #include "port/pg_bswap.h"
 
 extern void pq_beginmessage(StringInfo buf, char msgtype);
diff --git a/src/include/regex/regcustom.h b/src/include/regex/regcustom.h
index 82c9e2fad8..2506ac8268 100644
--- a/src/include/regex/regcustom.h
+++ b/src/include/regex/regcustom.h
@@ -52,7 +52,7 @@
 #include <wctype.h>
 #endif
 
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 
 #include "miscadmin.h"			/* needed by rcancelrequested/rstacktoodeep */
 
diff --git a/src/include/regex/regex.h b/src/include/regex/regex.h
index dc31899aa4..739cc7d14b 100644
--- a/src/include/regex/regex.h
+++ b/src/include/regex/regex.h
@@ -35,7 +35,7 @@
 /*
  * Add your own defines, if needed, here.
  */
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 
 /*
  * interface types etc.
diff --git a/src/include/tsearch/ts_locale.h b/src/include/tsearch/ts_locale.h
index 17536babfe..f77eb23c8a 100644
--- a/src/include/tsearch/ts_locale.h
+++ b/src/include/tsearch/ts_locale.h
@@ -15,7 +15,7 @@
 #include <ctype.h>
 #include <limits.h>
 
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "utils/pg_locale.h"
 
 /*
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index 80b54bc92b..f4db884735 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -23,12 +23,12 @@
 
 #include "common/ip.h"
 #include "common/link-canary.h"
+#include "common/pg_wchar.h"
 #include "common/scram-common.h"
 #include "common/string.h"
 #include "fe-auth.h"
 #include "libpq-fe.h"
 #include "libpq-int.h"
-#include "mb/pg_wchar.h"
 #include "pg_config_paths.h"
 #include "port/pg_bswap.h"
 
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c
index eea0237c3a..454c272807 100644
--- a/src/interfaces/libpq/fe-exec.c
+++ b/src/interfaces/libpq/fe-exec.c
@@ -24,9 +24,9 @@
 #include <unistd.h>
 #endif
 
+#include "common/pg_wchar.h"
 #include "libpq-fe.h"
 #include "libpq-int.h"
-#include "mb/pg_wchar.h"
 
 /* keep this in same order as ExecStatusType in libpq-fe.h */
 char	   *const pgresStatus[] = {
diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c
index a9074d2f29..261d64e7cd 100644
--- a/src/interfaces/libpq/fe-misc.c
+++ b/src/interfaces/libpq/fe-misc.c
@@ -47,9 +47,9 @@
 #include <sys/select.h>
 #endif
 
+#include "common/pg_wchar.h"
 #include "libpq-fe.h"
 #include "libpq-int.h"
-#include "mb/pg_wchar.h"
 #include "pg_config_paths.h"
 #include "port/pg_bswap.h"
 
diff --git a/src/interfaces/libpq/fe-protocol3.c b/src/interfaces/libpq/fe-protocol3.c
index 850bf84c96..799a1538da 100644
--- a/src/interfaces/libpq/fe-protocol3.c
+++ b/src/interfaces/libpq/fe-protocol3.c
@@ -26,9 +26,9 @@
 #endif
 #endif
 
+#include "common/pg_wchar.h"
 #include "libpq-fe.h"
 #include "libpq-int.h"
-#include "mb/pg_wchar.h"
 #include "port/pg_bswap.h"
 
 /*
diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c
index c78891868a..ac7144e99f 100644
--- a/src/pl/plperl/plperl.c
+++ b/src/pl/plperl/plperl.c
@@ -21,9 +21,9 @@
 #include "catalog/pg_type.h"
 #include "commands/event_trigger.h"
 #include "commands/trigger.h"
+#include "common/pg_wchar.h"
 #include "executor/spi.h"
 #include "funcapi.h"
-#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "nodes/makefuncs.h"
 #include "parser/parse_type.h"
diff --git a/src/pl/plperl/plperl_helpers.h b/src/pl/plperl/plperl_helpers.h
index 1e318b6dc8..cec942c280 100644
--- a/src/pl/plperl/plperl_helpers.h
+++ b/src/pl/plperl/plperl_helpers.h
@@ -1,7 +1,7 @@
 #ifndef PL_PERL_HELPERS_H
 #define PL_PERL_HELPERS_H
 
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 
 #include "plperl.h"
 
diff --git a/src/pl/plpgsql/src/pl_scanner.c b/src/pl/plpgsql/src/pl_scanner.c
index 9cea2e42ac..a5bb7c474c 100644
--- a/src/pl/plpgsql/src/pl_scanner.c
+++ b/src/pl/plpgsql/src/pl_scanner.c
@@ -15,7 +15,7 @@
  */
 #include "postgres.h"
 
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "parser/scanner.h"
 
 #include "plpgsql.h"
diff --git a/src/pl/plpython/plpy_cursorobject.c b/src/pl/plpython/plpy_cursorobject.c
index 4c37ff898c..01ad7cf3bc 100644
--- a/src/pl/plpython/plpy_cursorobject.c
+++ b/src/pl/plpython/plpy_cursorobject.c
@@ -10,7 +10,7 @@
 
 #include "access/xact.h"
 #include "catalog/pg_type.h"
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "plpy_cursorobject.h"
 #include "plpy_elog.h"
 #include "plpy_main.h"
diff --git a/src/pl/plpython/plpy_plpymodule.c b/src/pl/plpython/plpy_plpymodule.c
index e308c61d50..b079afc000 100644
--- a/src/pl/plpython/plpy_plpymodule.c
+++ b/src/pl/plpython/plpy_plpymodule.c
@@ -7,7 +7,7 @@
 #include "postgres.h"
 
 #include "access/xact.h"
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "plpy_cursorobject.h"
 #include "plpy_elog.h"
 #include "plpy_main.h"
diff --git a/src/pl/plpython/plpy_spi.c b/src/pl/plpython/plpy_spi.c
index 99c1b4f28f..8b7cfbf18c 100644
--- a/src/pl/plpython/plpy_spi.c
+++ b/src/pl/plpython/plpy_spi.c
@@ -11,8 +11,8 @@
 #include "access/htup_details.h"
 #include "access/xact.h"
 #include "catalog/pg_type.h"
+#include "common/pg_wchar.h"
 #include "executor/spi.h"
-#include "mb/pg_wchar.h"
 #include "parser/parse_type.h"
 #include "plpy_elog.h"
 #include "plpy_main.h"
diff --git a/src/pl/plpython/plpy_typeio.c b/src/pl/plpython/plpy_typeio.c
index e734b0d130..baf45526c6 100644
--- a/src/pl/plpython/plpy_typeio.c
+++ b/src/pl/plpython/plpy_typeio.c
@@ -8,8 +8,8 @@
 
 #include "access/htup_details.h"
 #include "catalog/pg_type.h"
+#include "common/pg_wchar.h"
 #include "funcapi.h"
-#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "plpy_elog.h"
 #include "plpy_main.h"
diff --git a/src/pl/plpython/plpy_util.c b/src/pl/plpython/plpy_util.c
index 4a7d7264d7..873afcfbb8 100644
--- a/src/pl/plpython/plpy_util.c
+++ b/src/pl/plpython/plpy_util.c
@@ -6,7 +6,7 @@
 
 #include "postgres.h"
 
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 #include "plpy_elog.h"
 #include "plpy_util.h"
 #include "plpython.h"
diff --git a/src/pl/tcl/pltcl.c b/src/pl/tcl/pltcl.c
index e7640008fd..47a328ba29 100644
--- a/src/pl/tcl/pltcl.c
+++ b/src/pl/tcl/pltcl.c
@@ -20,10 +20,10 @@
 #include "catalog/pg_type.h"
 #include "commands/event_trigger.h"
 #include "commands/trigger.h"
+#include "common/pg_wchar.h"
 #include "executor/spi.h"
 #include "fmgr.h"
 #include "funcapi.h"
-#include "mb/pg_wchar.h"
 #include "miscadmin.h"
 #include "nodes/makefuncs.h"
 #include "parser/parse_func.h"
diff --git a/src/port/chklocale.c b/src/port/chklocale.c
index c9c680f0b3..4ebc11bab8 100644
--- a/src/port/chklocale.c
+++ b/src/port/chklocale.c
@@ -23,7 +23,7 @@
 #include <langinfo.h>
 #endif
 
-#include "mb/pg_wchar.h"
+#include "common/pg_wchar.h"
 
 
 /*
-- 
2.21.1 (Apple Git-122.3)

