Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 333339

Summary: create/apply patch can't handle non-ascii characters. bad encoding -> no match
Product: [Eclipse Project] Platform Reporter: Martin Fleurke <martin.fleurke>
Component: TeamAssignee: Platform Team Inbox <platform-team-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.6.1   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Martin Fleurke CLA 2010-12-30 10:48:54 EST
Build Identifier: 20100917-0705

If you use e.g. ISO-8859-15 character set for your workspace and project, and you have a file with a character with an accent, e.g. ë (e+"), and you create a patch (team->create patch...->file, output format: unified, patch root:project, you get a file with hex value 'ef bf bd' instead of the ë ('eb' in hex). When you apply the patch to another project in iso-8859-15 encoding containing  the same file, you run into problems.
The patch file is read incorrectly, resulting in a '?' instead of an ë, and thus the match is not found, and the patch will fail (unmatched patch segment). For new files there is no match anyway, but you will end up with '?' instead of your accented letters.
If you use clipboard instead of file, you get the same results.

If you hex-edit the patch file and change the ef bf bd into 'c3 ab' (UTF-8), the apply patch works as intended.

I can only find bug 309430 as related, but my bug is still here, in 3.6.1.
Also, as fas as I can remember, it has existed much longer, so also in previous eclipse versions.

Reproducible: Always

Steps to Reproduce:
1. workspace encoding iso-8859-15 (or other non utf encoding with higher bit? -not tested), file encoding: inherited from container, also iso-8859-15.
2. create file with non-ascii character (ë has been tested).
3. create patch for lines with or near those characters
4. apply that patch to a similar project
Comment 1 Martin Fleurke CLA 2010-12-30 11:44:41 EST
PS: I use cvs. I'm not sure if that matters.
Comment 2 Tomasz Zarna CLA 2011-01-03 12:11:49 EST
Martin, isn't it a dupe of bug 214085?
Comment 3 Martin Fleurke CLA 2011-01-03 12:25:56 EST
I think so.
Comment 4 Tomasz Zarna CLA 2011-01-04 05:16:25 EST
Marking as a duplicate.

*** This bug has been marked as a duplicate of bug 214085 ***