Parse error at line 1, column 0: unknown encoding

3,353 views
Skip to first unread message

jirhiker

unread,
Apr 13, 2010, 4:18:10 PM4/13/10
to KML Developer Support - Getting Started with KML
Hello Group,

Im trying to load a kml file into GE and always get the following
error

Parse error at line 1, column 0: unknown encoding

This error is issued when trying to load any kml file even the
myplaces.kml that GE automatically creates.

Prior to this problem I had no problem writing and displaying KML and
KMZ files in GE

system details

Google Earth 5.1.3534.0411
Build Date Mar 26, 2010
Build Time 2:17:50 pm
Renderer OpenGL
Operating System Mac OS X (10.6.3)
Video Driver NVIDIA GeForce 8600M GT OpenGL Engine (2.1 NVIDIA-1.6.10)
Max Texture Size 8192x8192
Server kh.google.com


Thanks
Jake

Maarten L

unread,
Apr 13, 2010, 5:50:05 PM4/13/10
to KML Developer Support - Getting Started with KML
Open your kml file in a text editor. The first 2 lines should look
like this:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">

jirhiker

unread,
Apr 14, 2010, 10:58:30 AM4/14/10
to KML Developer Support - Getting Started with KML
Hi

I have checked that the kml file has those lines many times and as I
mentioned a KML file written by GE (myplaces.kml saved under ~/Library/
Application Support/Google Earth on Mac OSX)
fails to load.

When I turn KML error handling on in GE it says

Error while parsing file '/foo/test.kml' at line 2, column 0
Unknown Encoding <chinese characters >

It seems that I have a valid kml file, (ive tried files downloaded
from GE gallery and I use KML validation in my text editor) but still
cannot open in GE

I have also reinstalled GE multiple times.

Thanks
Jake

shannon9585

unread,
Apr 14, 2010, 12:28:39 PM4/14/10
to KML Developer Support - Getting Started with KML
If you getting a parsing error, I don't think reinstalling GE will
solve the problem - there must be some issue with the KML text. Have
you checked to make sure there is not a foreign character inserted
anywhere in the KML? Are all tags properly closed?

If you post the KML under "Files", we can take a look to better help
you.

jirhiker

unread,
Apr 14, 2010, 2:17:37 PM4/14/10
to KML Developer Support - Getting Started with KML
Hi

I just uploaded the myplaces.kml file to Files. This is the file
written by GE so theoretically there should be no foreign characters
(?) and GE should have no problem parsing files it constructs.

I feel as tho my problem is a little more insidious than simple stray
foreign characters, especially since 1) all KML files (even gallery
examples) tried result in a parse error 2) this not the first time
writing my own KML files and 3) ive had much success prior to this
parsing issue.

Thanks for the help and quick responses
Jake

shannon9585

unread,
Apr 16, 2010, 8:48:03 AM4/16/10
to KML Developer Support - Getting Started with KML
I was able to successfully open the KML you posted without getting any
parse errors. The file you posted doesn't have any Placemarks though,
it just defines the ListStyle.

I ran the file through a KML Validator (http://www.kmlvalidator.com/
home.htm) and it is not completely valid until you rearrange the order
of the ListStyle elements. The ListStyle elements should be in this
order:

<ListStyle>
<listItemType>check</listItemType>
<bgColor>00ffffff</bgColor>
<ItemIcon>
<state>open</state>
<href>/Applications/Google Earth.app/Contents/Resources/
mysavedplaces_open.png</href>
</ItemIcon>
<ItemIcon>
<state>closed</state>
<href>/Applications/Google Earth.app/Contents/Resources/
mysavedplaces_closed.png</href>
</ItemIcon>
<maxSnippetLines>2</maxSnippetLines>
</ListStyle>

I'm not sure that solves your problem at all, but you may try it and
see if that makes a difference.
> > you.- Hide quoted text -
>
> - Show quoted text -

--
You received this message because you are subscribed to the Google Groups "Getting Started with KML" group.
To post to this group, send email to kml-support-g...@googlegroups.com.
To unsubscribe from this group, send email to kml-support-getting...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/kml-support-getting-started?hl=en.

jirhiker

unread,
Apr 18, 2010, 2:14:54 AM4/18/10
to KML Developer Support - Getting Started with KML
No luck with that.

I find it odd that GE fails to open ever kml or kmz file.
> To post to this group, send email to [email address].
> To unsubscribe from this group, send email to [email address].
Reply all
Reply to author
Forward
0 new messages