commit 596a643eb60797c2405135311a50dcf30ffb71cb
parent 419c6e9a40accb7eb38d6fbd99eff7ead5e80bb0
Author: Sergej Orlov <wladimirych@gmail.com>
Date: Wed, 4 Jul 2018 02:35:40 +0300
[tracks control] strip BOM from OZI files. closes #84
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/lib/leaflet.control.track-list/lib/geo_file_formats.js b/src/lib/leaflet.control.track-list/lib/geo_file_formats.js
@@ -143,6 +143,7 @@ function parseGpx(txt, name, preferNameFromFile) {
function parseOziRte(txt, name) {
let error, segments = [];
+ txt = stripBom(txt);
const lines = txt.split('\n');
if (lines[0].indexOf('OziExplorer Route File') !== 0) {
return null;
@@ -181,6 +182,7 @@ function parseOziRte(txt, name) {
function parseOziPlt(txt, name) {
var error;
var segments = [];
+ txt = stripBom(txt);
var lines = txt.split('\n');
if (lines[0].indexOf('OziExplorer Track Point File') !== 0) {
return null;
@@ -256,6 +258,7 @@ function parseOziWpt(txt, name) {
lines, line,
i,
lat, lng, pointName, fields;
+ txt = stripBom(txt);
lines = txt.split('\n');
if (lines[0].indexOf('OziExplorer Waypoint File') !== 0) {
return null;