Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WB3sk-0006Wo-DS for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Feb 2014 14:55:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WB3sj-0002L1-SI for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Feb 2014 14:55:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WAxwn-0007qY-Ly for pgsql-bugs@postgresql.org; Wed, 05 Feb 2014 08:35:05 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WAxwk-0003pn-V3 for pgsql-bugs@postgresql.org; Wed, 05 Feb 2014 08:35:05 +0000 MIME-Version: 1.0 Subject: BUG #9111: National characters in the user profile name To: pgsql-bugs@postgresql.org From: cezary.dowhan@varico.pl Date: Wed, 05 Feb 2014 08:34:15 +0000 Message-ID: <20140205083415.26700.37722@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.9 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 9111 Logged by: Cezary Dowhan Email address: cezary.dowhan@varico.pl PostgreSQL version: 9.1.11 Operating system: Windows 7 Description: I would like to show my solution to the bug 9026. The problem stems from the fact that the console code page (OEMCP) is diffrent than default (system) code page (ACP). We must change the following fragment of code in initcluster.vbs: ' Execute a command Function DoCmd(strCmd) Dim objBatchFile Set objBatchFile = objTempFolder.CreateTextFile(strBatchFile, True) objBatchFile.WriteLine "@ECHO OFF" objBatchFile.WriteLine strCmd & " > """ & strOutputFile & """ 2>&1" objBatchFile.WriteLine "EXIT /B %ERRORLEVEL%" objBatchFile.Close WScript.Echo " Executing batch file '" & strBatchFile & "'..." DoCmd = objShell.Run(objTempFolder.Path & "\" & strBatchFile, 0, True) If objFso.FileExists(objTempFolder.Path & "\" & strBatchFile) = True Then objFso.DeleteFile objTempFolder.Path & "\" & strBatchFile, True Else WScript.Echo " Batch file '" & strBatchFile & "' does not exist..." End If If objFso.FileExists(strOutputFile) = True Then Dim objOutputFile Set objOutputFile = objFso.OpenTextFile(strOutputFile, ForReading) WScript.Echo " " & objOutputFile.ReadAll objOutputFile.Close objFso.DeleteFile strOutputFile, True Else WScript.Echo " Output file does not exists..." End If End Function Should be: ' Execute a command Function DoCmd(strCmd) Dim objBatchFile Set objBatchFile = objTempFolder.CreateTextFile(strBatchFile, True) objBatchFile.WriteLine "@ECHO OFF" objBatchFile.WriteLine "CHCP " & objShell.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage\ACP") objBatchFile.WriteLine strCmd & " > """ & strOutputFile & """ 2>&1" objBatchFile.WriteLine "EXIT /B %ERRORLEVEL%" objBatchFile.Close WScript.Echo " Executing batch file '" & strBatchFile & "'..." DoCmd = objShell.Run(objTempFolder.Path & "\" & strBatchFile, 0, True) If objFso.FileExists(objTempFolder.Path & "\" & strBatchFile) = True Then objFso.DeleteFile objTempFolder.Path & "\" & strBatchFile, True Else WScript.Echo " Batch file '" & strBatchFile & "' does not exist..." End If If objFso.FileExists(strOutputFile) = True Then Dim objOutputFile Set objOutputFile = objFso.OpenTextFile(strOutputFile, ForReading) WScript.Echo " " & objOutputFile.ReadAll objOutputFile.Close objFso.DeleteFile strOutputFile, True Else WScript.Echo " Output file does not exists..." End If End Function Probably the same change should be applied to other files. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs