From 0be165763af3b4068b7e9626fd0fa434c3956754 Mon Sep 17 00:00:00 2001 From: Ken ISHIMOTO Date: Tue, 1 Oct 2013 12:21:19 +0200 Subject: [PATCH] add UTF-8 migration SQLStatements from Input Stream the input for UTF-8 was bad on not UTF-8 Servers --- .../ERExtensions/Sources/er/extensions/jdbc/ERXSQLHelper.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/jdbc/ERXSQLHelper.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/jdbc/ERXSQLHelper.java index aa90ba26538..e513a8d9227 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/jdbc/ERXSQLHelper.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/jdbc/ERXSQLHelper.java @@ -1428,7 +1428,8 @@ else if (ch == '-' && prev == '-' && !inQuotes) { * if there is a problem reading the stream */ public NSArray splitSQLStatementsFromInputStream(InputStream is) throws IOException { - return splitSQLStatements(ERXStringUtilities.stringFromInputStream(is)); + String encoding = System.getProperty("file.encoding"); + return splitSQLStatements(ERXStringUtilities.stringIsNullOrEmpty(encoding) ? ERXStringUtilities.stringFromInputStream(is) : ERXStringUtilities.stringFromInputStream(is, encoding)); } /**