Community
Participate
Working Groups
Build Identifier: 20110301-1815 When creating a new PHP file, using the "Simple php file" code template, special characters such as German umlauts seem to be converted to ISO-8859-1 despite the workspace and file encoding being set to UTF-8. Setting the file encoding of the newly created PHP file to ISO-8859-1 in the file properties will reveal the umlauts, indicating that they are indeed converted. I also tried to override the template directly in "phpdefault-templates.xml" in "org.eclipse.php.ui_2.2.1.v20101001-2300.jar" using valid UTF-8 encoding and this didn't work either. The preview looks okay, so the issue might be somewhere in the code which puts the template contents into the editor / file. Reproducible: Always Steps to Reproduce: 1. Edit the "Simple php file" template to include German umlauts. 2. Create a new PHP file using the "Simple php file" template. 3. Watch Eclipse messing up the encoding of the generated file content.
I change the template to : <?php ${cursor} echo "赵忠伟"; And it works fine,if this bug still exist,please send you sample,thanks!
Example: <?php /** * Short description * * Long description * * @version $$Id$$ * @internal Encoding-check: >äöüÄÖÜ<. There shall be six umlauts within ><. */ ${cursor} Meanwhile, I found out that the bug only occurs when choosing "New" > "PHP File". It works fine when choosing "New" > "Untitled PHP File".
Created attachment 226301 [details] Result when using "New" > "PHP File"
Created attachment 226302 [details] Result when using "New" > "Untitled PHP File"
fixed
Verified. Umlauts appear just fine in new UTF-8 PHP files. Closing