Webtags (preserving history): Difference between revisions

m
Line 75: Line 75:
== Encoding ==
== Encoding ==


If you have problems with a web page not displaying the '''°''' symbol correctly, it will be because the character set encoding is either not declared or not consistent. Put simply, most modern web pages use "utf-8" encoding, as do the standard web templates included with Cumulus, but for historical reasons Cumulus defaults to producing report files in ISO-8859-1 encoding. This causes the mismatch.
=== Why does encoding matter?===


If you have problems with a web page not displaying the '''°''' symbol correctly, it will be because the character set encoding is either not declared or not consistent.
=== What encoding does my web page use?===
Put simply, most modern web pages start with this:
<pre>
<!DOCTYPE html>
<!-- the above must be on the first line by itself and tells the browser that HTML 5 applies -->
<html lang="en"><!-- modify this to indicate your language -->
<head>
<meta charset="UTF-8"><!-- assigns the recommended standard encoding that copes with all international characters -->
...
</pre>
The last line shown there is critical, it indicates that the web page uses "utf-8" encoding.
You will find that all standard web templates included with MX start as shown above. For Cumulus 1, from build 1094 up the various builds defined for final release, the above code is used. However for earlier builds of Cumulus 1, the standard web pages start as follows:
<pre><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type" /></pre>
The last line there shows how the original web templates (designed by Beth Loft) used the ISO 8859-1 character set. Consequently, the original NOAA reports used ISO-8859-1 encoding and for compatibility with this original setting, the default encoding for NOAA reports is unchanged despite the mismatch with web pages, because Cumulus 1 does not contain any web page to display NOAA reports.
===How does MX complicate encodings?===
MX complicates the issue, the admin interface does include a web page for displaying reports, (/CumulusMX/interface/noaayearreport.html). This web page includes <tt><meta charset="utf-8"></tt>, but the defaults prior to using the web page for editing NOAA settings (/CumulusMX/interface/noaasettings.html) include not using "utf-8" building in an inconsistency because there is nothing in the hints on that page to help you select reasonable settings!
===Consistency for encoding===
To add just a little more detail here, if you choose to implement a web page to display these Cumulus reports, then the HTML of the web page to display the report, the JavaScript that selects which report to show, and inserts the report into the HTML, and the report itself '''must all use the same encoding''', otherwise you will not get characters like &deg; displaying correctly.
To add just a little more detail here, if you choose to implement a web page to display these Cumulus reports, then the HTML of the web page to display the report, the JavaScript that selects which report to show, and inserts the report into the HTML, and the report itself '''must all use the same encoding''', otherwise you will not get characters like &deg; displaying correctly.


===When did Cumulus 1 change?===
In April 2014, Steve introduced the choice in Cumulus 1 of either ISO-8859-1 encoding (as he used originally) or UTF-8 encoding (what he migrated his web page templates to) for these reports.  For backwards compliance, the default selected by Steve Loft is his original ISO-8859-1 encoding, but his recommendation strongly expressed was that users should switch to UTF-8. This choice  with the former as default, but the latter as recommended, remains unchanged in MX.  The encoding for NOAA reports can be selected on the NOAA Settings screen of either Cumulus 1 or MX, and you are as Steve says strongly advised to reverse the setting.
In April 2014, Steve introduced the choice in Cumulus 1 of either ISO-8859-1 encoding (as he used originally) or UTF-8 encoding (what he migrated his web page templates to) for these reports.  For backwards compliance, the default selected by Steve Loft is his original ISO-8859-1 encoding, but his recommendation strongly expressed was that users should switch to UTF-8. This choice  with the former as default, but the latter as recommended, remains unchanged in MX.  The encoding for NOAA reports can be selected on the NOAA Settings screen of either Cumulus 1 or MX, and you are as Steve says strongly advised to reverse the setting.


===Relevance to Extra Web Files===
Before I go into any more technical detail, this same advice of selecting "UTF-8" applies to any choices on the '''Extra web files''' in MX (or Files tab of internet settings in Cumulus 1).
Before I go into any more technical detail, this same advice of selecting "UTF-8" applies to any choices on the '''Extra web files''' in MX (or Files tab of internet settings in Cumulus 1).


===TECHNICAL BIT===
'''With that introduction, you can now choose whether to read the rest of this section which uses more technical terminology.'''
'''With that introduction, you can now choose whether to read the rest of this section which uses more technical terminology.'''


Line 95: Line 124:
If you use 7 bits, you have 127 combinations, enough for standard 26 letters in both capitals, and lower case, plus 10 digits (0 to 9), some punctuation, and some control characters (like new line, end of file, and so on). If you use 8 bits, a whole byte, you have 254 combinations, and you can start coping with accented letters, with alphabets that don't have 26 letters, and even add some symbols. Obviously, once you start using more than one byte, you can have 16, 32, 64, or even more bits to use and can include lots more characters and the bigger character sets start including lots of symbols and the biggest add smilies or emotion icons.  
If you use 7 bits, you have 127 combinations, enough for standard 26 letters in both capitals, and lower case, plus 10 digits (0 to 9), some punctuation, and some control characters (like new line, end of file, and so on). If you use 8 bits, a whole byte, you have 254 combinations, and you can start coping with accented letters, with alphabets that don't have 26 letters, and even add some symbols. Obviously, once you start using more than one byte, you can have 16, 32, 64, or even more bits to use and can include lots more characters and the bigger character sets start including lots of symbols and the biggest add smilies or emotion icons.  
   
   
Remember, most modern web pages (including the standard web templates provided with both flavours of Cumulus) use UTF-8 encoding.
Remember, most modern web pages (including the standard web templates provided with both flavours of Cumulus) use UTF-8 encoding.  The only problem is MX not defaulting to this for NOAA reports.


== The format used for naming ==
== The format used for naming ==
5,838

edits