cloudy cloudy

Author Topic: How to remove this Byte Order Mark from Saratoga Template.  (Read 222 times)

0 Members and 1 Guest are viewing this topic.

Offline Weerstation

  • Posts: 383
  • The Netherlands
  • OS/Browser:
  • Win NT 10.0
  • Mozilla compatible
How to remove this Byte Order Mark from Saratoga Template.
« on: July 08, 2019, 12:39:35 PM »
well, I finally decided to ask this here after trying so many times to remove this.
I googled and learned this is Byte Order Mark.
Something to do with saving your file in the wrong format.
It is producing these 3 signs and as a result a white bar at the top of my website. (See image attached)
Signs are not always there, the white bar is.
I cannot find out what file this is causing.
I have changed many files back to original knowing I edited those. But no luck. #-o

My Site

Anyone knows where to look for?
TIA
« Last Edit: July 08, 2019, 12:43:27 PM by Weerstation »
Vantage Vue (Firmware 2.14 EU) - WeatherDisplay 10.37S build 99 - USB Weatherlink IP Data Logger

Windows 10 Home 64-bit - Acer Aspire Intel Core i5-8250U 1.6 GHz 8 Gb - Screen resolution 1920-1080

Offline wvdkuil

  • Wim van der Kuil
  • Posts: 1,291
  • Leuven Belgium CET
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 75.0.3770.100
    • My PWS at Leuven Belgium Europe
Re: How to remove this Byte Order Mark from Saratoga Template.
« Reply #1 on: July 08, 2019, 01:54:36 PM »
well, I finally decided to ask this here after trying so many times to remove this.
I googled and learned this is Byte Order Mark.
Something to do with saving your file in the wrong format.
It is producing these 3 signs and as a result a white bar at the top of my website. (See image attached)
Signs are not always there, the white bar is.
I cannot find out what file this is causing.
I have changed many files back to original knowing I edited those. But no luck. #-o

My Site

Anyone knows where to look for?
TIA
When inspectng the html of your page, one can see that these characters are inserted here
Code: [Select]
<div id="page"><!-- page wrapper -->

&#65279;

<!-- header -->
Those two comments come from header.php  where these lines default look like this
Code: [Select]
<div id="page"><!-- page wrapper -->
<!-- header -->
Your header.php looks like this
Code: [Select]
<div id="page"><!-- page wrapper -->

<?php include ('./EUwarning/wrnWarningv3.php');
 
#echo $wrnHead; // if you want the yellow box with your message 

 #echo  $wrnStrings // if you want the warnings before anything else remove the # 
?>



<!-- header -->
First remove all those lines and test again.
If the BOM characters disappear check the warning script.

IMPORTANT:  Most modern scripts are in UTF-8.
You should never ever use notepad.exe of ms-word to edit your scripts.
Always use the free program editor notepad++ (for  windows) or BB-edit on a Mac

If the wrnWarningv3.php script is causing this, open the file in notepad++ and when saving make sure it read UTF-8 w/o BOM, as in the screenshot,

Wim
« Last Edit: July 08, 2019, 01:58:25 PM by wvdkuil »

Offline saratogaWX

  • Global Moderator
  • Posts: 5,939
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 67.0
    • Saratoga Weather
Re: How to remove this Byte Order Mark from Saratoga Template.
« Reply #2 on: July 08, 2019, 02:24:43 PM »
WIth the Saratoga templates, you should NOT use UTF-8 when editing any of the files.  The template scripts are all in ISO-8859-n (not UTF-8).  All my scripts can produce UTF-8 output, but by default use ISO-8859-n when running in the Saratoga template.

https://saratoga-weather.org/wxtemplates/template-FAQ.php#FAQ2
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline wvdkuil

  • Wim van der Kuil
  • Posts: 1,291
  • Leuven Belgium CET
  • OS/Browser:
  • Mac OS X 10.13.6
  • Chrome 75.0.3770.100
    • My PWS at Leuven Belgium Europe
Re: How to remove this Byte Order Mark from Saratoga Template.
« Reply #3 on: July 08, 2019, 02:29:55 PM »
WIth the Saratoga templates, you should NOT use UTF-8 when editing any of the files.  The template scripts are all in ISO-8859-n (not UTF-8).  All my scripts can produce UTF-8 output, but by default use ISO-8859-n when running in the Saratoga template.

https://saratoga-weather.org/wxtemplates/template-FAQ.php#FAQ2
1. Fully correct, no problem with BOM.  For all Saratoga scripts.

2. But he is using my eu-warning scripts, and as all of my scripts, they are fully UTF-8.
The user should be careful editing those.   

3. His web-server is also UTF-8
Request URL: http://www.westland-depoel.nl/vantagevue/ws/wxindex.php
Response headers:
Content-Type: text/html; charset=UTF-8
Date: Mon, 08 Jul 2019 14:30:26 GMT


Using notepad++ one can never insert BOM by accident as the script-editor does not insert those characters. Only word-processing programs such as notepad.exe and MS-Word do that.

Wim
« Last Edit: July 08, 2019, 02:35:13 PM by wvdkuil »

Offline Weerstation

  • Posts: 383
  • The Netherlands
  • OS/Browser:
  • Win NT 10.0
  • Mozilla compatible
Re: How to remove this Byte Order Mark from Saratoga Template.
« Reply #4 on: July 08, 2019, 04:07:24 PM »
Ok thanks, I will have a look at that.

Wim, you refer to notepad.exe of ms-word.
Do you mean wordpad.exe
I thought it was ok to use notepad but not wordpad.
I recently installed notepad++.
Vantage Vue (Firmware 2.14 EU) - WeatherDisplay 10.37S build 99 - USB Weatherlink IP Data Logger

Windows 10 Home 64-bit - Acer Aspire Intel Core i5-8250U 1.6 GHz 8 Gb - Screen resolution 1920-1080

Offline niko

  • syzygy
  • Global Moderator
  • Posts: 28,126
  • Crystal Ball broken! Please post the URL.
  • Northern California, U.S.A.
  • OS/Browser:
  • Win 7/Srvr 2008R2
  • Chrome 75.0.3770.100
Re: How to remove this Byte Order Mark from Saratoga Template.
« Reply #5 on: July 08, 2019, 05:12:46 PM »
I thought it was ok to use notepad but not wordpad.

That was true with older versions of notepad, but later versions are more "sophisticated"  :roll:

Offline Weerstation

  • Posts: 383
  • The Netherlands
  • OS/Browser:
  • Win NT 10.0
  • Mozilla compatible
Re: How to remove this Byte Order Mark from Saratoga Template.
« Reply #6 on: July 08, 2019, 10:33:10 PM »
Fixed.  :D

"If the wrnWarningv3.php script is causing this, open the file in notepad++ and when saving make sure it read UTF-8 w/o BOM, as in the screenshot,"

The file said UTF-8 BOM when loaded in notepad++
I am using dutch lanquage, under Karakterset, I choose UTF-8 (Zonder BOM)
Then Saved.

Thanks.
Vantage Vue (Firmware 2.14 EU) - WeatherDisplay 10.37S build 99 - USB Weatherlink IP Data Logger

Windows 10 Home 64-bit - Acer Aspire Intel Core i5-8250U 1.6 GHz 8 Gb - Screen resolution 1920-1080