Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327537 - PDT does not remember project file encoding
Summary: PDT does not remember project file encoding
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: PHP Core CLA
QA Contact: Ilina Stefanova CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-12 06:49 EDT by Philipp Wolfer CLA
Modified: 2020-05-14 10:16 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Wolfer CLA 2010-10-12 06:49:02 EDT
If you set a project specific encoding for a PDT project this setting is not remembered if you close the project, restart Eclipse and re-open the project. E.g. I have set my workspace encoding to UTF-8, but to ISO-8859-1 for some older projects.

This can be solved by editing .settings/org.eclipse.php.core.prefs manually and adding the encoding line:
 encoding/<project>=ISO-8859-1

It also works for project types other than "PHP project", so to me it looks like PDT does not persist the settings correctly.

I am using the Eclipse Helios for PHP Developers release.
Comment 1 xu jiaxi CLA 2010-10-17 23:42:54 EDT
After I closed all the DLTK and PDT plugins in my workspace, and run the Eclipse Application, I also can reproduce this bug.

Maybe this is not a bug of PDT
Comment 2 Jacek Pospychala CLA 2010-10-18 04:24:40 EDT
I can see this on both PDT and generic project. I haven't seen line "encoding/<project>=..." added to org.eclipse.php.core.prefs.
Xu can you reassign this bug to Eclipse/Platform/Resources component? 
Thanks.
Comment 3 xu jiaxi CLA 2010-10-19 01:19:22 EDT
I downloaded a fresh Eclipse from eclipse.org. 
And I found everything works well on a JAVA project.
So does this mean there are still some bugs in some plugins. But I am not sure in which plugins.
How should we treat this bug?
Comment 4 Philipp Wolfer CLA 2010-10-19 03:51:57 EDT
Upon further looking into it adding the encoding to org.eclipse.php.core.prefs is just a work-around. Eclipse normally seems to add it to org.eclipse.core.resources.prefs, but sometimes stores the wrong value there. Adding it to org.eclipse.php.core.prefs seems to overwrite the value in org.eclipse.core.resources.prefs.

I am not sure to which component this bug belongs :( I will test this again with other project types.
Comment 5 Jacek Pospychala CLA 2010-10-19 04:44:41 EDT
Thanks for trying Philipp.
Xu, you're right. I used plain Eclipse-SDK 3.6.1 and created generic project and java project. Changed encodings to ISO-8859-1, closed, restared Eclipse and reopened projects. Encodings are preserved. Next I installed PDT from Helios repo, created php project, changed it's encoding to ISO-8859-1, closed, resterted eclipse and reopened project. Encoding is preserved.
Xu could you try to narrow down, when exactly is this happening? Maybe this is indeed caused by some other plugin, or maybe some problem with storing preferences during shutdown.
Comment 6 xu jiaxi CLA 2010-10-19 05:04:03 EDT
Jacek, I made some tries just now.
1. create project
2. change encoding
3. close project
4. restart pdt
5. open project 	// you will find the encoding reverted.
6. restart pdt
7. recheck the encoding, the encoding is set correctly.

Next I will try to narrow down
Comment 7 Zhongwei Zhao CLA 2011-05-04 04:01:55 EDT
why I could not reproduce this bug?
test on:
Version: 3.6.1
Build id: M20100909-0800
and latest pdt head
Comment 8 Toshihiro Izumi CLA 2011-05-04 04:25:03 EDT
duplicate of Bug 202384
Comment 9 Zhongwei Zhao CLA 2011-05-04 04:27:08 EDT
thanks,so I mark this bug fixed
Comment 10 Ilina Stefanova CLA 2011-08-01 08:53:23 EDT
Verified.