a standalone php file can be created and run; thus it seems that, just like
for standalone html or jsp or xml files, an encoding/charset kind of tag
should be part of the template and seeded with project encoding value and use feq.
(php web page is seeded with charset tag with project encoding value)
(header ('Content-type: text/html; charset="euc-jp"');
for example, to this standalone file,
when run it, it seems to do right thing as to setting
but seems it should be added for user, just as such
tags for new html, xml and jsp files are added for
Definitely not because
> header ('Content-type: text/html; charset="euc-jp"')
does exactly what you can read - sends a raw HTTP header. There's no relation between HTTP and script files.
Other thing is that you _cannot_ know whether this file is included in other PHP file or not.
I'm not clear - is the statement that php standalone files should not have en encoding
kind of tag - that perhaps the comparison used with html, jsp, xml files might not be
valid in php world ? please clarify.
also, if so, then what is requirement for user who uses non ascii in this file and chooses
to run it - they won't see their characters ok, whereas users who use ascii only will -
this seems discriminating to the users. if we provide a run funtionality for standalone file
it should work for all users ?
please reopen as needed or explain why it should not be.
> I'm not clear - is the statement that php standalone files should not have en encoding
> kind of tag - that perhaps the comparison used with html, jsp, xml files might not be
> valid in php world
If you have a PHP file (no HTML) then IDE cannot help much. Such PHP script is similar to shell scripts and so it is
up to user what output the script produces, which encoding he uses in console etc.
but the ide or php code should help/do the right thing - since this is a php nb
functionality to run the file - and this can be done for some other file types
of other projects
will retry to see if run php file to show in ow or web page
is ok without need for any encoding tag, and will reopen if not
since php module should handle encoding to allow it to happen.
Sorry, but still not clear what "the right thing" means - how can NB find out what is it? Does it mean that NB should
e.g. connect to user's database and find out the encoding of data and then somehow change user's code? Or try to
recognize whether the currently edited file is a script for console or just some fragment which will be included in
some other PHP script in runtime? How?? As I said, not sure what you mean by this term.
good points about scope of it -
am actually just talking now about simple print of a string to the ow
since if it worked in that case, it would mean at least that the correct
encoding is being communicated - just like in a html file or jsp file,
there is just one meta charset or page encoding statement at beginning of file
and that assumption is used thruout.
the reason i had mentioned in this issue about adding
header ('Content-type: text/html; charset="euc-jp"'); (or some encoding value)
is that in some mail communication with php alias, it was mentioned to try
this in php file to see if it solved the problem of this issue as to
the print of some mbyte in standalone php file not working
but you mentioned here that is not valid approach at least for this case
(ie to seed the php file with that statement, and since also it could conflict
with such statements of encoding in other php or html files)