From fabc2a02b94ae3f56fc5ffbe89fce900adcebe70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cabe=CC=81?= Date: Thu, 22 Oct 2015 13:22:36 +0200 Subject: [PATCH] =?UTF-8?q?Bug=20480407=20-=20Arduino=20Y=C3=BAn=20name=20?= =?UTF-8?q?is=20mangled=20in=20the=20UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Chain the FileReader (which uses default character encoding) with an InputStreamReader in order to force UTF-8 encoding Change-Id: Ia32c079a18f580e36f1629182bfb829ab8f71c71 Signed-off-by: Benjamin Cabé --- .../cdt/arduino/core/internal/board/ArduinoPlatform.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/board/ArduinoPlatform.java b/toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/board/ArduinoPlatform.java index 4c57d95dae1..4bc524fd00a 100644 --- a/toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/board/ArduinoPlatform.java +++ b/toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/board/ArduinoPlatform.java @@ -9,8 +9,11 @@ package org.eclipse.cdt.arduino.core.internal.board; import java.io.BufferedReader; import java.io.File; +import java.io.FileInputStream; import java.io.FileReader; import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; import java.io.Reader; import java.io.StringReader; import java.net.URL; @@ -102,7 +105,9 @@ public class ArduinoPlatform { public List getBoards() throws CoreException { if (isInstalled() && boardsProperties == null) { Properties boardProps = new Properties(); - try (Reader reader = new FileReader(getInstallPath().resolve("boards.txt").toFile())) { //$NON-NLS-1$ + + try (InputStream is = new FileInputStream(getInstallPath().resolve("boards.txt").toFile()); + Reader reader = new InputStreamReader(is, "UTF-8")) { //$NON-NLS-1$ boardProps.load(reader); } catch (IOException e) { throw new CoreException(new Status(IStatus.ERROR, Activator.getId(), "Loading boards.txt", e)); //$NON-NLS-1$