File tree 3 files changed +20
-1
lines changed
app/test/processing/app/windows
arduino-core/src/processing/app/helpers
3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 1
1
package processing .app .windows ;
2
2
3
3
import org .junit .Test ;
4
+ import processing .app .helpers .FileUtils ;
5
+
6
+ import java .io .File ;
4
7
5
8
import static org .junit .Assert .assertEquals ;
6
9
@@ -39,4 +42,12 @@ public void testRegQueryParserXP() throws Exception {
39
42
assertEquals ("C:\\ Documents and Settings\\ username\\ My Documents" , folderPath );
40
43
}
41
44
45
+ @ Test
46
+ public void testRegQueryParserGerman () throws Exception {
47
+ String output = FileUtils .readFileToString (new File (RegQueryParserTest .class .getResource ("german.reg.query.output.txt" ).getFile ()), "Cp852" );
48
+
49
+ String folderPath = new RegQueryParser (output ).getValueOfKey ();
50
+ assertEquals ("C:\\ Users\\ René\\ AppData\\ Roaming" , folderPath );
51
+ }
52
+
42
53
}
Original file line number Diff line number Diff line change
1
+
2
+ HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
3
+ AppData REG_SZ C:\Users\Ren�\AppData\Roaming
4
+
Original file line number Diff line number Diff line change @@ -177,9 +177,13 @@ public static boolean isSCCSFolder(File file) {
177
177
}
178
178
179
179
public static String readFileToString (File file ) throws IOException {
180
+ return readFileToString (file , "UTF-8" );
181
+ }
182
+
183
+ public static String readFileToString (File file , String encoding ) throws IOException {
180
184
BufferedReader reader = null ;
181
185
try {
182
- reader = new BufferedReader (new InputStreamReader (new FileInputStream (file ), "UTF-8" ));
186
+ reader = new BufferedReader (new InputStreamReader (new FileInputStream (file ), encoding ));
183
187
StringBuilder sb = new StringBuilder ();
184
188
String line ;
185
189
while ((line = reader .readLine ()) != null ) {
You can’t perform that action at this time.
0 commit comments