Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=45852
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 24 Sep 2008 15:47:40 +0000 (15:47 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 24 Sep 2008 15:47:40 +0000 (15:47 +0000)
Add special handling a for charset that Java uses a non-default name for

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

res/tomcat.nsi

index c70263c..d306320 100644 (file)
@@ -535,8 +535,11 @@ Silent:
   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"
-
+  StrCmp $R8 "932" 0 +3
+    ; Special case where Java uses non-standard name for character set
+    FileWrite $R9 "<?xml version='1.0' encoding='ms$R8'?>$\r$\n"
+    Goto +2
+    FileWrite $R9 "<?xml version='1.0' encoding='cp$R8'?>$\r$\n"
   Push "$TEMP\confinstall\tomcat-users_1.xml"
   Call copyFile
   FileWrite $R9 $R5