diff --git a/src/backend/commands/collationcmds.c b/src/backend/commands/collationcmds.c
index 110fb7e..d5d734b 100644
--- a/src/backend/commands/collationcmds.c
+++ b/src/backend/commands/collationcmds.c
@@ -411,10 +411,10 @@ get_icu_locale_comment(const char *localename)
 Datum
 pg_import_system_collations(PG_FUNCTION_ARGS)
 {
-#if defined(HAVE_LOCALE_T) && !defined(WIN32)
 	bool		if_not_exists = PG_GETARG_BOOL(0);
 	Oid			nspid = PG_GETARG_OID(1);
 
+#if defined(HAVE_LOCALE_T) && !defined(WIN32)
 	FILE	   *locale_a_handle;
 	char		localebuf[NAMEDATALEN]; /* we assume ASCII so this is fine */
 	int			count = 0;
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 968bb33..6ba98a0 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -216,6 +216,12 @@ s{PG_VERSION_STR "[^"]+"}{PG_VERSION_STR "PostgreSQL $self->{strver}$extraver, c
 			print $o "#define HAVE_LIBXSLT\n";
 			print $o "#define USE_LIBXSLT\n";
 		}
+
+		if ($self->{options}->{icu})
+		{
+			print $o "#define USE_ICU\n";
+		}
+
 		if ($self->{options}->{gss})
 		{
 			print $o "#define ENABLE_GSS 1\n";
@@ -543,6 +549,15 @@ sub AddProject
 		$proj->AddIncludeDir($self->{options}->{nls} . '\include');
 		$proj->AddLibrary($self->{options}->{nls} . '\lib\libintl.lib');
 	}
+
+	if ($self->{options}->{icu})
+	{
+		$proj->AddIncludeDir($self->{options}->{icu} . '\include');
+		$proj->AddLibrary($self->{options}->{icu} . '\lib\icuin.lib');
+		$proj->AddLibrary($self->{options}->{icu} . '\lib\icuuc.lib');
+		$proj->AddLibrary($self->{options}->{icu} . '\lib\icudt.lib');
+	}
+
 	if ($self->{options}->{gss})
 	{
 		$proj->AddIncludeDir($self->{options}->{gss} . '\inc\krb5');
@@ -676,6 +691,7 @@ sub GetFakeConfigure
 	$cfg .= ' --with-ossp-uuid'     if ($self->{options}->{uuid});
 	$cfg .= ' --with-libxml'        if ($self->{options}->{xml});
 	$cfg .= ' --with-libxslt'       if ($self->{options}->{xslt});
+	$cfg .= ' --with-icu'           if ($self->{options}->{icu});
 	$cfg .= ' --with-gssapi'        if ($self->{options}->{gss});
 	$cfg .= ' --with-tcl'           if ($self->{options}->{tcl});
 	$cfg .= ' --with-perl'          if ($self->{options}->{perl});
diff --git a/src/tools/msvc/config_default.pl b/src/tools/msvc/config_default.pl
index 93f7887..49f5f65 100644
--- a/src/tools/msvc/config_default.pl
+++ b/src/tools/msvc/config_default.pl
@@ -25,6 +25,7 @@ our $config = {
 	xml       => undef,    # --with-libxml=<path>
 	xslt      => undef,    # --with-libxslt=<path>
 	iconv     => undef,    # (not in configure, path to iconv)
+	icu	  => undef,    # --with-icu=<path>
 	zlib      => undef     # --with-zlib=<path>
 };
 
