From 16e1bfafa9ea078aefc65eab578403218b530b0c Mon Sep 17 00:00:00 2001 From: jboffel Date: Fri, 17 Apr 2015 01:11:58 +0900 Subject: [PATCH] Fix for UTF-8 source code When reporting problem in eclipse code editor from CodeSniffer if there are UTF-8 characters the starting offset to display where is the error is miscalculated. It is just needed to correctly set the charset to the InputStreamReader... --- src/org/phpsrc/eclipse/pti/core/php/source/PHPSourceFile.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/phpsrc/eclipse/pti/core/php/source/PHPSourceFile.java b/src/org/phpsrc/eclipse/pti/core/php/source/PHPSourceFile.java index 10dfc48..d3c0e27 100644 --- a/src/org/phpsrc/eclipse/pti/core/php/source/PHPSourceFile.java +++ b/src/org/phpsrc/eclipse/pti/core/php/source/PHPSourceFile.java @@ -43,7 +43,7 @@ private void determineLinePositions(IFile file) throws CoreException, IOExceptio lineStartTabCount = new ArrayList(); InputStreamReader isr; - isr = new InputStreamReader(file.getContents()); + isr = new InputStreamReader(file.getContents(), file.getCharset()); int last = -1; int i = 0;