Bug 64567 - [encoding] SaveAs does not transfer charset (and BOM)
Summary: [encoding] SaveAs does not transfer charset (and BOM)
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-28 11:17 EDT by Dani Megert CLA
Modified: 2019-11-27 07:05 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2004-05-28 11:17:47 EDT
I200405280010

If the original file has an explicit encoduing (charset/BOM) we currently don't
transfer it to the new one. This is not what the user expects.

Use Case:
1. set folder F encoding to X
2. set encoding of file a to Y
3. open a
4. save as b in folder F
==> might end up in scrambled text
Comment 1 Kai-Uwe Maetzel CLA 2004-06-25 11:02:51 EDT
Removing target milestone, no further action for 3.0.
Comment 2 Assaf Urieli CLA 2004-09-30 11:34:22 EDT
Similar situation: copying source files from one project (default cp1252) to
another project (default utf-8). Ideally, the encoding of the file should be
changed from cp1252 to utf-8, with appropriate conversions. Instead, the text
becomes scrambled.
Comment 3 Dani Megert CLA 2004-10-01 03:56:28 EDT
Not the same issue: if you move (or copy) the file nothing gets lost. You might
see scrambled text when opening but you can simply change the encoding manually
so that the file looks good again. When taking the wrong encoding upon save (as)
you might actually loose work.
Comment 4 Bob Foster CLA 2005-02-18 17:06:40 EST
Should file a separate bug report for Assaf's issue, then.
Comment 5 Dani Megert CLA 2005-02-18 17:22:53 EST
Bob, I agree - too bad that Assaf isn't on the cc-list - can you file it? I am
normally very reluctant to put other people on the cc-list without their knowledge.
Comment 6 Mahesh Maney CLA 2013-04-12 08:51:21 EDT
Hi,
Is this Bug resolved. I'm facing the same problem with Indigo Eclipse too. Can some please confirm.
Comment 7 Mahesh Maney CLA 2013-04-12 08:58:46 EDT
Sorry, forgot to add the build ID
Version: 3.7.0
Build id: I20110613-1736

The use case is :
        1. I have opened a Japanese font converted File
        2. Choose Save-AS
        3. Select the project from the workspace and provide a file-name.
        4. click on OK.
        5. Save could not be Completed. Some Characters cannot be mapped using "Cp1252" character encoding. Either change the encoding or remove the characters which are not supported by the "Cp1252" character encoding.

When i debug, here's what i found. In the org.eclipse.ui.editors.text.FileDocumentProvider.doSaveDocument(IProgressMonitor, Object, IDocument, boolean) method, the encoding was set "Cp1252" and while executing ByteBuffer byteBuffer= encoder.encode(CharBuffer.wrap(document.get()));
the above exception is thrown.

I had tried setting it to "ISO-8859-1" and also to Japanese charset, but in vain. i end up in the same exception.

Can someone please comment on this bug please ?
Comment 8 Dani Megert CLA 2013-04-12 12:02:15 EDT
(In reply to comment #6)
> Hi,
> Is this Bug resolved. I'm facing the same problem with Indigo Eclipse too.
> Can some please confirm.

No it is open, as you can see yourself.
Comment 9 Lars Vogel CLA 2019-11-27 07:05:44 EST
This bug hasn't had any activity in quite some time. Maybe the problem got
resolved, was a duplicate of something else, or became less pressing for some
reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it.
The information can be, for example, that the problem still occurs, that you
still want the feature, that more information is needed, or that the bug is
(for whatever reason) no longer relevant.

If the bug is still relevant, please remove the stalebug whiteboard tag.