Strange results when putting "Gauges" in template (RESOLVED)

Hi,
I’ve installed the latest Steel Gauges and it works fine on this page:
http://www.jolietwx.com/gauges-ss-basic.htm

I then basically copy and pasted the gauges-ss-basic.htm file in a wxnewpage.php. I had to make the gauges smaller but notice the temp and dew point gauges. the numbers are off and the gauges have an “A” in front of the

Hi,
that “A” is caused by encoding problems. You probably copied the code from HTML that used different encoding than you have on your site. If you use Notepad++ there is a command to convert encoding so make sure that the script code uses the same as your html.

Your site uses: ISO-8859-1

The gauges JS uses: UTF-8

Thanks, I’ll check it out!
I downloaded Notepad++ and couldn’t see an ISO-8859-1 for conversion. It said my template and gauges-ss-basic-.htm are both UTF-8. Why would it affect the “temperature” gauges?
jim

It’s not just the encoding of the files you need to consider. Your web server is returning a header to the browser saying it is…

Content-Type:text/html; charset=ISO-8859-1

And you have a tag in the page header also saying it is…

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

You have to ensure the files have the same encoding as the web server is telling the browser otherwise you get these mismatches. If you convert the gauges.js file to ISO-8859-1 in decent editor, it should be OK. Some editors make a hash of it and add those ‘spurious’ characters into the source file, if that happens you have to search for the degree character and change it manually.

Thanks Mark

I think I’ll just leave it as a separate page. :smiley:
Jim

Jim,
Since your site seems to be at current release, you can change the wxgauges.php page from

require_once("common.php");
############################################################################
#
$TITLE = langtransstr($SITE['organ']) . " - " .langtransstr('Current Weather Gauges');

to

require_once("common.php");
############################################################################
$useHTML5 = true;  // force this page to use HTML5 instead of XHTML 1.0-Transitional
$useUTF8 = true;   // force this page to convert language files to UTF8 for display
#
$TITLE = langtransstr($SITE['organ']) . " - " .langtransstr('Current Weather Gauges');

and the page will display using HTML5 and UTF8 for the gauges :slight_smile:

That worked and it was easy, thanks so much Ken!
jim