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 240763 Details for
Bug 429895
File is mangled on save
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]
possible patch
PR429895.patch (text/plain), 1.61 KB, created by
Silenio Quarti
on 2014-03-11 12:34:36 EDT
(
hide
)
Description:
possible patch
Filename:
MIME Type:
Creator:
Silenio Quarti
Created:
2014-03-11 12:34:36 EDT
Size:
1.61 KB
patch
obsolete
>diff --git a/bundles/org.eclipse.orion.server.servlets/src/org/eclipse/orion/internal/server/servlets/file/FileHandlerV1.java b/bundles/org.eclipse.orion.server.servlets/src/org/eclipse/orion/internal/server/servlets/file/FileHandlerV1.java >index 282a166..883b9ed 100644 >--- a/bundles/org.eclipse.orion.server.servlets/src/org/eclipse/orion/internal/server/servlets/file/FileHandlerV1.java >+++ b/bundles/org.eclipse.orion.server.servlets/src/org/eclipse/orion/internal/server/servlets/file/FileHandlerV1.java >@@ -114,11 +114,19 @@ class FileHandlerV1 extends GenericFileHandler { > private void handlePatchContents(HttpServletRequest request, BufferedReader requestReader, HttpServletResponse response, IFileStore file) throws IOException, CoreException, NoSuchAlgorithmException, JSONException, ServletException { > JSONObject changes = OrionServlet.readJSONRequest(request); > //read file to memory >- Reader fileReader = new InputStreamReader(file.openInputStream(EFS.NONE, null)); >+ Reader fileReader = new InputStreamReader(file.openInputStream(EFS.NONE, null), "UTF-8"); > StringWriter oldFile = new StringWriter(); > IOUtilities.pipe(fileReader, oldFile, true, false); > StringBuffer oldContents = oldFile.getBuffer(); > >+ // Remove the BOM character if it exists >+ if (oldContents.length() > 0) { >+ char firstChar = oldContents.charAt(0); >+ if (firstChar == '\uFEFF' || firstChar == '\uFFFE') { >+ oldContents.replace(0, 1, ""); >+ } >+ } >+ > JSONArray changeList = changes.getJSONArray("diff"); > for (int i = 0; i < changeList.length(); i++) { > JSONObject change = changeList.getJSONObject(i);
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 429895
:
240661
| 240763 |
241101