Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333339 - create/apply patch can't handle non-ascii characters. bad encoding -> no match
Summary: create/apply patch can't handle non-ascii characters. bad encoding -> no match
Status: RESOLVED DUPLICATE of bug 214085
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 3.6.1   Edit
Hardware: PC Linux
: P3 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform Team Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-30 10:48 EST by Martin Fleurke CLA
Modified: 2011-01-04 05:16 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***