Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=45332
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 6 Jul 2008 19:31:20 +0000 (19:31 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 6 Jul 2008 19:31:20 +0000 (19:31 +0000)
Specify the correct encoding (the current windows code page) rather than assuming UTF-8 when creating tomcat-users.xml

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@674335 13f79535-47bb-0310-9956-ffa450edef68

res/confinstall/tomcat-users_1.xml
res/tomcat.nsi

index c0fae76..cde187d 100644 (file)
@@ -1,4 +1,3 @@
-<?xml version='1.0' encoding='utf-8'?>
 <!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
index 6842b3b..c69283e 100644 (file)
@@ -541,6 +541,9 @@ Silent:
   
   Delete "$INSTDIR\conf\tomcat-users.xml"
   FileOpen $R9 "$INSTDIR\conf\tomcat-users.xml" w
+  ; File will be written using current windows codepage
+  System::Call 'Kernel32::GetACP() i .r18'
+  FileWrite $R9 "<?xml version='1.0' encoding='cp$R8'?>$\r$\n"
 
   Push "$TEMP\confinstall\tomcat-users_1.xml"
   Call copyFile