Bug 139478 - I18N - new php project wizard seeds encoding not with utf-8
I18N - new php project wizard seeds encoding not with utf-8
Status: RESOLVED INVALID
Product: php
Classification: Unclassified
Component: Project
6.x
Sun All
: P2 (vote)
: 6.x
Assigned To: Tomas Mysik
issues@php
: I18N
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-07-09 19:57 UTC by Ken Frank
Modified: 2008-07-25 19:39 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ken Frank 2008-07-09 19:57:01 UTC
as per Tomas comments in 122412, am filing this to have the default
php encoding value shown in the new php project wizard be that
of utf-8, and not the encoding if the locale user is in when running nb.

also, is there a reason why php new project wizard asks for encoding value;
most nb projects , besides freeform I believe, do not and just use utf-8
as default, and user then can change it within project props.

I'm not saying its not a helpful item, but just different than other projects.

There is RFE filed to have global ide option for project encoding, since otherwise
for other projects, to change the project encoding one needs to either:

a. change the encoding of existing project via project props and then change
encoding of all files created at time of project creation, or of project
import of existing project; potentially lots of work.

b. change project encoding of some other project, even if just a non used
project, then create php project and it will be in that encoding;
but also seems to be unneeded steps, and not clear process for doing it IMO.
Comment 1 Ken Frank 2008-07-09 20:15:28 UTC
to clarify, I was running in solaris ja locale for this case;
same would happen when users run in windows, since there is not
even a utf-8 ja locale to run in.

ken.frank@sun.com
Comment 2 Tomas Mysik 2008-07-25 10:36:14 UTC
My comment from issue #122412:

> UTF-8 is definitely the most widely used encoding in PHP applications IMHO.

is true - but this doesn't mean that PHP project behaviour should be inconsistent with other project types. And one 
can find this combo in the new project wizard because if one imports some existing project, IDE is not able to 
reliably recognize file encoding (moreover, each file can have different encoding, why not).

The default value is taken from user's system - once changed, it is remembered and next time offered as a default. 
This is expected behaviour, the same like in all the project types.
Comment 3 Ken Frank 2008-07-25 17:02:14 UTC
Tomas,

I don't think default project value is taken from system for other project type - it uses
utf-8 if for that session and/or user dir, no other encoding had been chosen in any
project, otherwise it uses the current view of global project encoding

ie if I change project encoding of some project to euc-jp, then all future projects
will use that encoding, until project encoding of some project is changed again.
if no project encoding ever changed, then utf-8 will continue to be used.

but you mention 
The default value is taken from user's system - once changed, it is remembered and next time offered as a default. 
This is expected behaviour, the same like in all the project types.

--> other project types don't provide such choices in new wizard, so don't know if its applicable
here, but I think the question is, why would not the current global project encoding
value be presented, rather than the encoding of the locale user is in ? That does not seem
consistent with how other project types handle things.

please reopen if this is valid comments.

ken.frank@sun.com
Comment 4 Tomas Mysik 2008-07-25 18:16:29 UTC
> I don't think default project value is taken from system for other project type

> why would not the current global project encoding value be presented, rather than the encoding of the locale user is
> in ? That does not seem consistent with how other project types handle things.

In fact, PHP project is using FileEncodingQuery.getDefaultEncoding() which is the same like in J2SE project. However I 
will try to investigate with clean userdir and new J2SE project and let you know. Thanks.
Comment 5 Tomas Mysik 2008-07-25 18:47:40 UTC
Ken, you are right - the default encoding is always UTF-8.

I was wrong because I use Linux with UTF-8 as system locale - now I verified on Windows (windows-1250) that for both 
Java and PHP project the default encoding is UTF-8 (as I wrote, PHP project uses the same approach as J2SE project).

So the behaviour is consistent for all the project types.
Comment 6 Ken Frank 2008-07-25 19:39:38 UTC
using recent builds, its ok - project encoding is seeded in new wizard
with current proj encoding value 
and if change proj encoding value in php proj props, then new project,
like j2se one for example, uses that encoding - as per feq.

ken.frank@sun.com


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo