diff --git a/bin/install.pike b/bin/install.pike
index ba8d6d3ab143a68ecb213d27cdd4993cd5834287..b17e26841095524ef0a28cc90f8c66be68ce4246 100644
--- a/bin/install.pike
+++ b/bin/install.pike
@@ -2,7 +2,7 @@
 
 // Pike installer and exporter.
 //
-// $Id: install.pike,v 1.199 2008/12/02 05:45:40 peter Exp $
+// $Id: install.pike,v 1.200 2009/03/05 11:36:24 grubba Exp $
 
 // Windows installer FIXMEs:
 //
@@ -2387,17 +2387,17 @@ void make_master(string dest, string master, string lib_prefix,
     error("Failed to read master template file %O\n", master);
   }
   master_data=replace(master_data, ({
-			"¤lib_prefix¤",
-			"¤include_prefix¤",
-			"¤share_prefix¤",
-			"¤doc_prefix¤",
-			"¤cflags¤",
-			"¤ldflags¤",
+			"#lib_prefix#",
+			"#include_prefix#",
+			"#share_prefix#",
+			"#doc_prefix#",
+			"#cflags#",
+			"#ldflags#",
 		      }), ({
 			replace(lib_prefix,"\\","\\\\"),
 			replace(include_prefix,"\\","\\\\"),
-			replace(share_prefix||"¤share_prefix¤", "\\", "\\\\"),
-			replace(doc_prefix||"¤doc_prefix¤", "\\", "\\\\"),
+			replace(share_prefix||"#share_prefix#", "\\", "\\\\"),
+			replace(doc_prefix||"#doc_prefix#", "\\", "\\\\"),
 			replace(cflags||"", "\\", "\\\\"),
 			replace(ldflags||"", "\\", "\\\\"),
 		      }));
diff --git a/lib/master.pike.in b/lib/master.pike.in
index 1b8eb7fe902c823d6c9d5148807f7a5c044d8f7e..df06ab5cc53aaacd30a9cad74731bcd17e47dda4 100644
--- a/lib/master.pike.in
+++ b/lib/master.pike.in
@@ -6,17 +6,11 @@
 // Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 // for more information.
 //
-// $Id: master.pike.in,v 1.460 2008/10/12 21:55:33 mast Exp $
+// $Id: master.pike.in,v 1.461 2009/03/05 11:44:17 grubba Exp $
 
 #pike __REAL_VERSION__
 //#pragma strict_types
 
-// Some programs destroys character pairs beginning with the currency
-// symbol when running in chinese locale.
-#if "¤/" != "\244/"
-#error "master.pike.in is corrupted."
-#endif
-
 //! @appears predef::MasterObject
 //!
 //! Master control program for Pike.
@@ -163,8 +157,8 @@ protected class Pike_0_5_master
   object low_cast_to_object(string oname, string current_file);
   extern array(string) pike_include_path;
   string pike_library_path =
-#if "¤lib_prefix¤"[0]!='¤'
-    "¤lib_prefix¤"
+#if "#lib_prefix#"[0]!='#'
+    "#lib_prefix#"
 #else
     __DIR__
 #endif
@@ -2089,33 +2083,33 @@ protected void create()
   CO(remove_call_out);
   CO(call_out_info);
 
-#if "¤share_prefix¤"[0]!='¤'
+#if "#share_prefix#"[0]!='#'
   // add path for architecture-independant files
-  add_include_path("¤share_prefix¤/include");
-  add_module_path("¤share_prefix¤/modules");
+  add_include_path("#share_prefix#/include");
+  add_module_path("#share_prefix#/modules");
 #endif
 
-#if "¤lib_prefix¤"[0]!='¤'
+#if "#lib_prefix#"[0]!='#'
   // add path for architecture-dependant files
-  add_include_path("¤lib_prefix¤/include");
-  add_module_path("¤lib_prefix¤/modules");
+  add_include_path("#lib_prefix#/include");
+  add_module_path("#lib_prefix#/modules");
 #endif
 
-#if "¤cflags¤ "[0]!='¤'
-  cflags = "¤cflags¤";
+#if "#cflags# "[0]!='#'
+  cflags = "#cflags#";
 #endif
 
-#if "¤ldflags¤ "[0]!='¤'
-  ldflags = "¤ldflags¤";
+#if "#ldflags# "[0]!='#'
+  ldflags = "#ldflags#";
 #endif
 
-#if "¤include_prefix¤"[0]!='¤'
-  include_prefix = "¤include_prefix¤";
+#if "#include_prefix#"[0]!='#'
+  include_prefix = "#include_prefix#";
   cflags = (cflags || "") + " -I" + dirname(include_prefix);
 #endif
 
-#if "¤doc_prefix¤"[0]!='¤'
-  doc_prefix = "¤doc_prefix¤";
+#if "#doc_prefix#"[0]!='#'
+  doc_prefix = "#doc_prefix#";
 #endif
 
 #if constant(__embedded_resource_directory)
@@ -5599,10 +5593,10 @@ CompatResolver get_compilation_handler(int major, int minor)
   array(string) files;
   array(Version) available=({});
 
-#if "¤share_prefix¤"[0]!='¤'
-  if (!(files = master_get_dir("¤share_prefix¤"))) {
+#if "#share_prefix#"[0]!='#'
+  if (!(files = master_get_dir("#share_prefix#"))) {
     werror ("Error listing directory %O: %s\n",
-	    "¤share_prefix¤", strerror (errno()));
+	    "#share_prefix#", strerror (errno()));
     files = ({});
   }
   foreach(files, string ver)
@@ -5616,10 +5610,10 @@ CompatResolver get_compilation_handler(int major, int minor)
     }
 #endif
 
-#if "¤lib_prefix¤"[0]!='¤'
-  if (!(files = master_get_dir("¤lib_prefix¤"))) {
+#if "#lib_prefix#"[0]!='#'
+  if (!(files = master_get_dir("#lib_prefix#"))) {
     werror ("Error listing directory %O: %s\n",
-	    "¤lib_prefix¤", strerror (errno()));
+	    "#lib_prefix#", strerror (errno()));
     files = ({});
   }
   foreach(files, string ver)
@@ -5670,14 +5664,14 @@ CompatResolver get_compilation_handler(int major, int minor)
 	}
 
 	string base;
-#if "¤lib_prefix¤"[0]!='¤'
-	base=combine_path("¤lib_prefix¤",sprintf("%s",tmp));
+#if "#lib_prefix#"[0]!='#'
+	base=combine_path("#lib_prefix#",sprintf("%s",tmp));
 	compat_handler->add_module_path(combine_path(base,"modules"));
 	compat_handler->add_include_path(combine_path(base,"include"));
 #endif
 
-#if "¤share_prefix¤"[0]!='¤'
-	base=combine_path("¤share_prefix¤",sprintf("%s",tmp));
+#if "#share_prefix#"[0]!='#'
+	base=combine_path("#share_prefix#",sprintf("%s",tmp));
 	compat_handler->add_module_path(combine_path(base,"modules"));
 	compat_handler->add_include_path(combine_path(base,"include"));
 #endif
diff --git a/packaging/windows/installer.vbs b/packaging/windows/installer.vbs
index 7d2f2f5ccd4a6d10e271754d21fce3910036e452..8ef7667bbd1ca514357c8b2e26c908aed443b4cb 100644
--- a/packaging/windows/installer.vbs
+++ b/packaging/windows/installer.vbs
@@ -1,23 +1,28 @@
 '
-' $Id: installer.vbs,v 1.4 2008/06/28 19:26:39 mast Exp $
+' $Id: installer.vbs,v 1.5 2009/03/05 11:36:24 grubba Exp $
 '
 ' Companion file to bin/install.pike for custom actions.
 '
 ' 2004-12-01 Henrik Grubbström
 '
 
+Option Compare Binary
+
 ' At call time the CustomActionData property has been set to [TARGETDIR]
 Function FinalizePike()
-  Dim fso, targetdir, targetdir_unix, source, dest, re
+  Dim fso, targetdir, targetdir_unix, source, source_txt, dest, re
   targetdir = Session.Property("CustomActionData")
 
   Set fso = CreateObject("Scripting.FileSystemObject")
 
+  ' Note: Opening the files in ASCII-mode, there doesn't seem to be any
+  '       binary mode. This means that 8-bit characters might get mangled.
   Set source = fso.OpenTextFile(targetdir & "lib\master.pike.in", 1, False, 0)
+  Set dest = fso.CreateTextFile(targetdir & "lib\master.pike", 2, True, 0)
 
-  Set dest = fso.CreateTextFile(targetdir & "lib\master.pike", True)
+  source_txt = source.ReadAll
 
-  source = source.ReadAll
+  source.Close
 
   Set re = New RegExp
   re.Global = True
@@ -25,16 +30,16 @@ Function FinalizePike()
   re.Pattern = "\\"
   targetdir_unix = re.Replace(targetdir, "/")
 
-  re.Pattern = "¤lib_prefix¤"
-  source = re.Replace(source, targetdir_unix & "lib")
+  re.Pattern = "#lib_prefix#"
+  source_txt = re.Replace(source_txt, targetdir_unix & "lib")
 
-  re.Pattern = "¤include_prefix¤"
-  source = re.Replace(source, targetdir_unix & "include/pike")
+  re.Pattern = "#include_prefix#"
+  source_txt = re.Replace(source_txt, targetdir_unix & "include/pike")
 
-  're.Pattern = "¤share_prefix¤"
-  'source = re.Replace(source, "¤share_prefix¤")
+  're.Pattern = "#share_prefix#"
+  'source_txt = re.Replace(source_txt, "#share_prefix#")
 
-  dest.Write(source)
+  dest.Write(source_txt)
   dest.Close
 
   ' Warning: It appears to be very difficult to call pike from here to do
diff --git a/src/Makefile.in b/src/Makefile.in
index bfbda8a91c1c77d641f0f841d2089cd1c14187a7..c85db689db9a605b7cab40d8c75ff0914f6bedc7 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile.in,v 1.472 2009/01/28 16:28:42 agehall Exp $
+# $Id: Makefile.in,v 1.473 2009/03/05 11:36:25 grubba Exp $
 #
 
 # This line is needed on some machines.
@@ -925,9 +925,9 @@ master.pike: $(LIBDIR_SRC)/master.pike.in Makefile
           else u='s/^#undef PIKE_MODULE_RELOC/#define PIKE_MODULE_RELOC 1/'; \
         fi; \
 	LC_ALL=C; export LC_ALL; \
-	cmd="sed -e 's![^ -~]lib_prefix[^ -~]!`echo '$(TMP_LIBDIR)' | ./posix_to_native.sh`!' \
-	  -e 's![^ -~]share_prefix[^ -~]!`echo '$(LIBDIR_SRC)' | ./posix_to_native.sh`!' \
-	  -e 's![^ -~]include_prefix[^ -~]!`echo '$(TMP_BUILDDIR)/bundles/include/pike' | ./posix_to_native.sh`!' \
+	cmd="sed -e 's!#lib_prefix#!`echo '$(TMP_LIBDIR)' | ./posix_to_native.sh`!' \
+	  -e 's!#share_prefix#!`echo '$(LIBDIR_SRC)' | ./posix_to_native.sh`!' \
+	  -e 's!#include_prefix#!`echo '$(TMP_BUILDDIR)/bundles/include/pike' | ./posix_to_native.sh`!' \
 	  -e '$$u'"; \
 	echo "$$cmd <$(LIBDIR_SRC)/master.pike.in >master.pike"; \
 	eval $$cmd <$(LIBDIR_SRC)/master.pike.in >master.pike || { rm "master.pike"; exit 1; }