This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 204726 - NetBeans ignore project charset
Summary: NetBeans ignore project charset
Status: CLOSED WORKSFORME
Alias: None
Product: php
Classification: Unclassified
Component: Smarty (show other bugs)
Version: 7.0.1
Hardware: All All
: P2 normal (vote)
Assignee: Martin Fousek
URL:
Keywords: I18N
Depends on:
Blocks:
 
Reported: 2011-11-06 20:24 UTC by greyhard
Modified: 2011-11-15 17:40 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
steps screenshot (851.58 KB, application/zip)
2011-11-12 11:08 UTC, greyhard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description greyhard 2011-11-06 20:24:15 UTC
Product Version = NetBeans IDE 7.0.1 (Build 201107282000)
Operating System = Mac OS X version 10.7.2 running on x86_64
Java; VM; Vendor = 1.6.0_26
Runtime = Java HotSpot(TM) 64-Bit Server VM 20.1-b02-383

Create project with cp1251 codepage, then save a Document via ssh to remote system Netbeans convert Document to UTF-8 and save.
When reopen a document Netbeans open it in cp1251 as defined in project prop. And i see a UTF-8 strings in file.
Comment 1 Jesse Glick 2011-11-07 15:56:58 UTC
Unsure what component "save a Document via ssh" belongs to; not in Java IDE. Reporter, what type of project are you working on?
Comment 2 greyhard 2011-11-07 19:59:59 UTC
I have a php project in cp1251.
Create Netbeans Project with PHP from remote host (via sftp) and define codepage a cp1251.
Fetch and open. All in cp1251 displays normally.
Then try open change and save.
Open OK , save OK, auto upload to remote host OK.
When open is browser i see a wrong codepage.
Log to host and check file. file is UTF-8.
Reopen file in netbeans i see a UTF-8 strings in file.
Try replace strings and save again. and again see UTF-8 =(
Comment 3 greyhard 2011-11-07 20:36:00 UTC
fix with add in config: 
netbeans_default_options="-J-Dfile.encoding=CP1251"

this not a good 
because i think while project set in cp1251 i want save all in cp1251 without any netbeans config params )
Comment 4 Tomas Mysik 2011-11-08 10:25:36 UTC
Works for me. What I did exactly:

- create new PHP project
- set its encoding to e.g. Windows-1250
- in this project, create a PHP file with some non-ascii characters, e.g. "ščřěúů"
- setup SFTP connection
- upload the file

The uploaded file is correct, I have verified it using xxd linux command.

If my steps are incorrect, please, provide your _exact_ steps to reproduce.

Thanks for reporting.

Product Version: NetBeans IDE Dev (Build 20111108-11f907be773e)
Java: 1.6.0_24; Java HotSpot(TM) 64-Bit Server VM 19.1-b02
System: Linux version 3.0.0-12-generic running on amd64; UTF-8; cs_CZ (nb)
Comment 5 greyhard 2011-11-12 11:08:32 UTC
Created attachment 113145 [details]
steps screenshot

0. at start (step1.png)
1 run netbeans
2 create php project from remote source
3 set cp1251 and php 5.3 (step2.png)
4 configure sftp
5 fetch project
6 open index.tmpl (step4.png)
7 save index 
8 upload to host
10 see (step3.png) already utf-8 =(
11 reopen index.tmpl
12 see utf-8 in file (step5.png)
Comment 6 Tomas Mysik 2011-11-14 08:44:20 UTC
From the screen shot, I see that it is Smarty related. Please, evaluate.

Thanks.
Comment 7 Martin Fousek 2011-11-14 09:59:53 UTC
Thanks for reporting but I'm not able to reproduce that even for .tpl files. I retried that also for multilevel directory structure, for .tmpl file which were registered as TPL files and still no success by reproducing. 

Actually latest version of encoding support for TPL files should be available just in daily build of NetBeans7.1 since it was not efficient to transplant all patches for older versions and propagate them to Plugin Portal UC. Please could you try that in lastest dev build?
http://bits.netbeans.org/download/trunk/nightly/latest/

You will not need to install there the Smarty plugin since NB7.1 it will be bundled as a part of IDE. Thanks...
Comment 8 Martin Fousek 2011-11-15 15:54:50 UTC
Ok, I'm closing as workforme since I'm not able to reproduce this issue and encoding works well to me. Greyhard please, reopen this issue if you would be able to reproduce it in the latest build:
http://bits.netbeans.org/download/trunk/nightly/latest/

Thanks...
Comment 9 greyhard 2011-11-15 16:55:10 UTC
everything works fine, thank you
Comment 10 Martin Fousek 2011-11-15 17:40:39 UTC
Thanks for letting us know.