mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-04 23:55:26 +02:00
Bug 480407 - Arduino Yún name is mangled in the UI
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é <benjamin@eclipse.org>
This commit is contained in:
parent
8cc9e5f3f0
commit
fabc2a02b9
1 changed files with 6 additions and 1 deletions
|
@ -9,8 +9,11 @@ package org.eclipse.cdt.arduino.core.internal.board;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
import java.io.FileReader;
|
import java.io.FileReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
import java.io.StringReader;
|
import java.io.StringReader;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
@ -102,7 +105,9 @@ public class ArduinoPlatform {
|
||||||
public List<ArduinoBoard> getBoards() throws CoreException {
|
public List<ArduinoBoard> getBoards() throws CoreException {
|
||||||
if (isInstalled() && boardsProperties == null) {
|
if (isInstalled() && boardsProperties == null) {
|
||||||
Properties boardProps = new Properties();
|
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);
|
boardProps.load(reader);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new CoreException(new Status(IStatus.ERROR, Activator.getId(), "Loading boards.txt", e)); //$NON-NLS-1$
|
throw new CoreException(new Status(IStatus.ERROR, Activator.getId(), "Loading boards.txt", e)); //$NON-NLS-1$
|
||||||
|
|
Loading…
Add table
Reference in a new issue