moved from #6555 to avoid drowning the PR
@JM thank you for clarifying that .ini should NOT be no BOM
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=27783
unfortunately I had missed that tracker item.
But in the docs, added March 2015 it says no BOM
https://docs.joomla.org/Creating_a_language_definition_file
I think it would be good to clarify this once and for all as I am hearing people are still having problems with 3x and BOM.
If BOM is to be the future rule perhaps it would be a good idea to give this some more publicity? What do you think please? Pse let me know if I can help.
Labels |
Added:
?
|
thanks @Gitjk :)
This is what I am trying to ascertain - I too thought ini files should be no BOM
until
@infograf768 said this in the other PR -
In fact, we do not need No BOM anymore in 3.x as parse_ini does not need it.
See: https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/language/language.php#L869
From what I understand reading the FAQ at unicode.org, "UTF-8 is the byte-oriented encoding form of Unicode" and because Joomla language file keys are limited to ASCII characters, the following recommendation from their FAQ applies: "Some byte oriented protocols expect ASCII characters at the beginning of a file. If UTF-8 is used with these protocols, use of the BOM as encoding form signature should be avoided."
However, correct me if I misunderstand that.
parse_ini does not need a utf8 .ini file to be NO BOM. It will though work OK in joomla if NO BOM.
(UTF8 NO BOM is absolutely necessary when a non-ascii glyph is used in a .PHP file.)
What I was quoting in the other issue is a code we introduced a loooooong time ago on 1.6 to prevent throwing an error if there was a BOM when DEBUG was on:
See https://bugs.php.net/bug.php?id=45991 where it was corrected in php
Thank you JM for your answers and links for further reading. May I try and summarise the situation as I think it is now please?
Joomla .ini files no longer need No BOM at the top:
Note : All ini files need to be saved as UTF-8 - No BOM
Joomla core still contains .ini files that contain that Note.
New Joomla .ini files do not (and should not) contain No BOM note
Are those all facts please?
We are left with this in docs:
https://docs.joomla.org/Creating_a_language_definition_file
should the NO BOM part be removed in the first sentence?
Do any .ini files within Joomla core that contain the NO BOM note need to be adjusted? Does adding NO BOM break anything?
Apologies if this is too simplistic!
Ini language files can have or not a BOM.
Joomla and parse_ini php function do not care.
It is indeed not necessary to have in the ini file
Note : All ini files need to be saved as UTF-8 - No BOM
it is sufficient to have
Note : All ini files need to be saved as UTF-8
we, as of today have 89 ini files in J! with the - no BOM
and 264 without.
It is easy to mass change the 89 files.
Pull Request created #6584
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-03-26 09:43:09 |
Closed_By | ⇒ | brianteeman |
Excellent - thank you to @infograf768 for clarifying definitively and changing the joomla doc & @brianteeman doing the PR - good result!
@Hils
"@JM thank you for clarifying that .ini should NOT be no BOM"
If you are referring to that old tracker id 27783, I'm pretty shure you misunderstood that: It just says
"Avoid BOM error when debug****, as BOM is OK when using parse_ini, ...This is wrong as parse_ini does not require ini lang files to be encoded with NO BOM."__
Afaik, the language files still should be 'no BOM'.
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6574.