# HG changeset patch # User Alexander Simon # Date 1258965449 -10800 # Node ID 8a69df0e3301a2014b5db96d0cb3f43079e37be6 # Parent a2034c89052cfe8490d25adfd317d80548722f6e BZ#177016 Can't build a project with localized path with smart secure copy: - additional fix for opening files from profiler results diff -r a2034c89052c -r 8a69df0e3301 cnd.dwarfdump/src/org/netbeans/modules/cnd/dwarfdump/reader/ByteStreamReader.java --- a/cnd.dwarfdump/src/org/netbeans/modules/cnd/dwarfdump/reader/ByteStreamReader.java Sat Nov 21 00:44:35 2009 +0300 +++ b/cnd.dwarfdump/src/org/netbeans/modules/cnd/dwarfdump/reader/ByteStreamReader.java Mon Nov 23 11:37:29 2009 +0300 @@ -284,13 +284,30 @@ public String readString() throws IOException { StringBuilder str = new StringBuilder(); - byte b = -1; - + long beg = getFilePointer(); + int b = -1; + boolean isUTF = false; while (b != 0) { - b = readByte(); + b = readByte() & 0xFF; if (b != 0) { str.append((char)b); + } + if (b > 127) { + isUTF = true; + } + } + + if (isUTF) { + long end = getFilePointer(); + seek(beg); + try { + String s = readUTF(str.length()); + return s; + } catch (IOException ex) { + return str.toString(); + } finally { + seek(end); } }