Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 97940 Details for
Bug 225047
DBCS3.4: Externalize Strings halts when using DBCS characters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch
clipboard.txt (text/plain), 2.41 KB, created by
Benjamin Cabé
on 2008-04-29 05:40:34 EDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Benjamin Cabé
Created:
2008-04-29 05:40:34 EDT
Size:
2.41 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.ui >Index: src/org/eclipse/pde/internal/ui/nls/StringHelper.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/StringHelper.java,v >retrieving revision 1.7 >diff -u -r1.7 StringHelper.java >--- src/org/eclipse/pde/internal/ui/nls/StringHelper.java 16 Jan 2008 17:08:33 -0000 1.7 >+++ src/org/eclipse/pde/internal/ui/nls/StringHelper.java 29 Apr 2008 09:35:01 -0000 >@@ -11,24 +11,39 @@ > package org.eclipse.pde.internal.ui.nls; > > public class StringHelper { >+ private static final char[] HEX_DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; > >- protected static String preparePropertiesString(String s, char[] newLine) { >+ public static String preparePropertiesString(String s, char[] newLine) { > if (s == null) > return null; > int length = s.length(); > int nlLength = newLine.length; > StringBuffer sb = new StringBuffer(length + nlLength); >- for (int i = 0; i < length; i++) { >+ int i = 0; >+ while (i < length) { > char c = s.charAt(i); > if (i + nlLength < length) { > boolean notNewLine = false; > for (int j = 0; j < nlLength; j++) > if (s.charAt(i + j) != newLine[j]) > notNewLine = true; >- if (!notNewLine) >- sb.append("\\"); //$NON-NLS-1$ >+ if (!notNewLine) { >+ sb.append(unwindEscapeChars(new String(newLine))); >+ // skip the nl chars >+ i += nlLength; >+ while (i < length && s.charAt(i) == ' ') { >+ sb.append(' '); >+ i++; >+ } >+ if (i < length) { >+ sb.append("\\"); //$NON-NLS-1$ >+ sb.append(newLine); >+ } >+ continue; >+ } > } >- sb.append(c); >+ sb.append(unwindEscapeChars(Character.toString(c))); >+ i++; > } > return sb.toString(); > } >@@ -60,10 +75,17 @@ > return "\\r";//$NON-NLS-1$ > case '\\' : > return "\\\\";//$NON-NLS-1$ >+ default : >+ if (((c < 0x0020) || (c > 0x007e))) >+ return new StringBuffer().append('\\').append('u').append(toHex((c >> 12) & 0xF)).append(toHex((c >> 8) & 0xF)).append(toHex((c >> 4) & 0xF)).append(toHex(c & 0xF)).toString(); > } > return String.valueOf(c); > } > >+ private static char toHex(int halfByte) { >+ return HEX_DIGITS[(halfByte & 0xF)]; >+ } >+ > protected static String windEscapeChars(String s) { > if (s == null) > return null;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 225047
: 97940 |
97942
|
98399
|
98400
|
98401