Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

character encodings not working

2008-08-13
2013-03-17
  • michelle evans
    michelle evans
    2008-08-13

    I'm trying to convert an Airports of the world KML file to CSV.  The GUI shows the correct names with correct character encodings, but the output CSV file does not. 

    "Čačak-Preljina Airport" is shown in the source KML and GUI of KMLCSV.  However the output value in the CSV file is: "?a?ak-Preljina Airport"

    This happens for several character values.

    Any fixes? 

    This program still does it better than FME 2008, but neither is getting me all valid data.

    Michelle
    michelle.evans@publicearth.com

     
    • Would it be possible for you to attach a KML file with these special characters in it? I want to rerun it on my end, and see if I can produce a fix for it. thanks. You can email this KML file to me at meteoric at rocketmail dot com.

       
      • michelle evans
        michelle evans
        2008-08-13

        You bet...let me know if this does not work...search for the string "Býčí skála Cave"

        <?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://earth.google.com/kml/2.2"><Document>    <name>Caves.kml</name>    <Style id="nature">        <IconStyle>            <color>ff00aa00</color>            <scale>0.6</scale>            <Icon>                <href>http://maps.google.com/mapfiles/kml/pal4/icon60.png</href>            </Icon>        </IconStyle>        <LabelStyle>            <color>ff00aa00</color>            <scale>0.8</scale>        </LabelStyle>    </Style>    <Folder>        <name>Caves</name>        <visibility>0</visibility>        <Folder>            <name>Asia</name>            <visibility>0</visibility>            <open>1</open>            <Folder>                <name>Georgia</name>                <visibility>0</visibility>                <open>1</open>                <Placemark>                    <name>Voronya Cave</name>                    <visibility>0</visibility>                    <description><![CDATA[<a href="http://en.wikipedia.org/wiki/Voronya Cave">Wikipedia</a>]]></description>                    <LookAt>                        <longitude>40.3622222222222</longitude>                        <latitude>43.4097222222222</latitude>                        <altitude>0</altitude>                        <range>20000</range>                        <tilt>0</tilt>                        <heading>0</heading>                    </LookAt>                    <styleUrl>#nature</styleUrl>                    <Point>                        <coordinates>40.3622222222222,43.4097222222222,0</coordinates>                    </Point>                </Placemark>            </Folder>            <Folder>                <name>India</name>                <visibility>0</visibility>                <Placemark>                    <name>Ajanta Caves</name>                    <visibility>0</visibility>                    <description><![CDATA[<a href="http://en.wikipedia.org/wiki/Ajanta Caves">Wikipedia</a>]]></description>                    <LookAt>                        <longitude>75.7497222222222</longitude>                        <latitude>20.5336111111111</latitude>                        <altitude>0</altitude>                        <range>20000</range>                        <tilt>0</tilt>                        <heading>0</heading>                    </LookAt>                    <styleUrl>#nature</styleUrl>                    <Point>                        <coordinates>75.7497222222222,20.5336111111111,0</coordinates>                    </Point>                </Placemark>            </Folder>        </Folder>        <Folder>            <name>Australia and Oceania</name>            <visibility>0</visibility>            <Folder>                <name>Australia</name>                <visibility>0</visibility>                <Placemark>                    <name>Hermit's Cave</name>                    <visibility>0</visibility>                    <description><![CDATA[<a href="http://en.wikipedia.org/wiki/Hermit's Cave">Wikipedia</a>]]></description>                    <LookAt>                        <longitude>146.069</longitude>                        <latitude>-34.262</latitude>                        <altitude>0</altitude>                        <range>20000</range>                        <tilt>0</tilt>                        <heading>0</heading>                    </LookAt>                    <styleUrl>#nature</styleUrl>                    <Point>                        <coordinates>146.069,-34.262,0</coordinates>                    </Point>                </Placemark>            </Folder>            <Folder>                <name>New Zealand</name>                <visibility>0</visibility>                <Placemark>                    <name>Cathedral Caves</name>                    <visibility>0</visibility>                    <description><![CDATA[<a href="http://en.wikipedia.org/wiki/Cathedral Caves">Wikipedia</a>]]></description>                    <LookAt>                        <longitude>169.381266666667</longitude>                        <latitude>-46.6084444444444</latitude>                        <altitude>0</altitude>                        <range>20000</range>                        <tilt>0</tilt>                        <heading>0</heading>                    </LookAt>                    <styleUrl>#nature</styleUrl>                    <Point>                        <coordinates>169.381266666667,-46.6084444444444,0</coordinates>                    </Point>                </Placemark>            </Folder>        </Folder>        <Folder>            <name>Europe</name>            <visibility>0</visibility>            <open>1</open>            <Folder>                <name>Austria</name>                <visibility>0</visibility>                <open>1</open>                <Folder>                    <name>Salzburg</name>                    <visibility>0</visibility>                    <Placemark>                        <name>Eisriesenwelt</name>                        <visibility>0</visibility>                        <description><![CDATA[<a href="http://en.wikipedia.org/wiki/Eisriesenwelt">Wikipedia</a>]]></description>                        <LookAt>                            <longitude>13.1897222222222</longitude>                            <latitude>47.5027777777778</latitude>                            <altitude>0</altitude>                            <range>20000</range>                            <tilt>0</tilt>                            <heading>0</heading>                        </LookAt>                        <styleUrl>#nature</styleUrl>                        <Point>                            <coordinates>13.1897222222222,47.50277777777779,0</coordinates>                        </Point>                    </Placemark>                </Folder>            </Folder>            <Folder>                <name>Czech Republic</name>                <visibility>0</visibility>                <Placemark>                    <name>Býčí skála Cave</name>                    <visibility>0</visibility>                    <description><![CDATA[<a href="http://en.wikipedia.org/wiki/Býčí skála Cave">Wikipedia</a>]]></description>                    <LookAt>                        <longitude>16.6947222222222</longitude>                        <latitude>49.3075</latitude>                        <altitude>0</altitude>                        <range>20000</range>                        <tilt>0</tilt>                        <heading>0</heading>                    </LookAt>                    <styleUrl>#nature</styleUrl>                    <Point>                        <coordinates>16.6947222222222,49.3075,0</coordinates>                    </Point>                </Placemark>            </Folder>            <Folder>                <name>Finland</name>                <visibility>0</visibility>                <Placemark>                    <name>Wolf Cave</name>                    <visibility>0</visibility>                    <description><![CDATA[<a href="http://en.wikipedia.org/wiki/Wolf Cave">Wikipedia</a>]]></description>                    <LookAt>                        <longitude>21.6715361111111</longitude>                        <latitude>62.3030083333333</latitude>                        <altitude>0</altitude>                        <range>20000</range>                        <tilt>0</tilt>                        <heading>0</heading>                    </LookAt>                    <styleUrl>#nature</styleUrl>                    <Point>                        <coordinates>21.6715361111111,62.3030083333333,0</coordinates>                    </Point>                </Placemark>            </Folder>            <Folder>                <name>France</name>                <visibility>0</visibility>                <Placemark>                    <name>Aven Armand</name>                    <visibility>0</visibility>                    <description><![CDATA[<a href="http://en.wikipedia.org/wiki/Aven Armand">Wikipedia</a>]]></description>                    <LookAt>                        <longitude>3.35722222222222</longitude>                        <latitude>44.2211111111111</latitude>                        <altitude>0</altitude>                        <range>20000</range>                        <tilt>0</tilt>                        <heading>0</heading>                    </LookAt>                    <styleUrl>#nature</styleUrl>                    <Point>                        <coordinates>3.35722222222222,44.2211111111111,0</coordinates>                    </Point>                </Placemark>                <Placemark>                    <name>Cosquer Cave</name>                    <visibility>0</visibility>                    <description><![CDATA[<a href="http://en.wikipedia.org/wiki/Cosquer Cave">Wikipedia</a>]]></description>                    <LookAt>                        <longitude>5.44916666666667</longitude>                        <latitude>43.2027777777778</latitude>                        <altitude>0</altitude>                        <range>20000</range>                        <tilt>0</tilt>                        <heading>0</heading>                    </LookAt>                    <styleUrl>#nature</styleUrl>                    <Point>                        <coordinates>5.44916666666667,43.2027777777778,0</coordinates>                    </Point>                </Placemark>            </Folder>            <Folder>                <name>Germany</name>                <visibility>0</visibility>                <Placemark>                    <name>Blauhöhle</name>                    <visibility>0</visibility>                    <description><![CDATA[<a href="http://en.wikipedia.org/wiki/Blauhöhle">Wikipedia</a>]]></description>                    <LookAt>                        <longitude>9.783888888888891</longitude>                        <latitude>48.4163888888889</latitude>                        <altitude>0</altitude>                        <range>20000</range>                        <tilt>0</tilt>                        <heading>0</heading>                    </LookAt>                    <styleUrl>#nature</styleUrl>                    <Point>                        <coordinates>9.783888888888891,48.41638888888891,0</coordinates>                    </Point>                </Placemark>            </Folder>            <Folder>                <name>Greece</name>                <visibility>0</visibility>                <Placemark>                    <name>Melissani Cave</name>                    <visibility>0</visibility>                    <description><![CDATA[<a href="http://en.wikipedia.org/wiki/Melissani Cave">Wikipedia</a>]]></description>                    <LookAt>                        <longitude>22.0666666666667</longitude>                        <latitude>38.3</latitude>                        <altitude>0</altitude>                        <range>20000</range>                        <tilt>0</tilt>                        <heading>0</heading>                    </LookAt>                    <styleUrl>#nature</styleUrl>                    <Point>                        <coordinates>22.0666666666667,38.3,0</coordinates>                    </Point>                </Placemark>            </Folder>            <Folder>                <name>Slovakia</name>                <visibility>0</visibility>                <Placemark>                    <name>Belianska Cave</name>                    <visibility>0</visibility>                    <description><![CDATA[<a href="http://en.wikipedia.org/wiki/Belianska Cave">Wikipedia</a>]]></description>                    <LookAt>                        <longitude>20.3133333333333</longitude>                        <latitude>49.2258333333333</latitude>                        <altitude>0</altitude>                        <range>20000</range>                        <tilt>0</tilt>                        <heading>0</heading>                    </LookAt>                    <styleUrl>#nature</styleUrl>                    <Point>                        <coordinates>20.3133333333333,49.2258333333333,0</coordinates>                    </Point>                </Placemark>                <Placemark>                    <name>Demänovská Ice Cave</name>                    <visibility>0</visibility>                    <description><![CDATA[<a href="http://en.wikipedia.org/wiki/Demänovská Ice Cave">Wikipedia</a>]]></description>                    <LookAt>                        <longitude>19.5819444444444</longitude>                        <latitude>48.9986111111111</latitude>                        <altitude>0</altitude>                        <range>20000</range>                        <tilt>0</tilt>                        <heading>0</heading>                    </LookAt>                    <styleUrl>#nature</styleUrl>                    <Point>                        <coordinates>19.5819444444444,48.99861111111111,0</coordinates>                    </Point>                </Placemark>            </Folder>            <Folder>                <name>Spain</name>                <visibility>0</visibility>                <Placemark>                    <name>Cueva de los Verdes</name>                    <visibility>0</visibility>                    <description><![CDATA[<a href="http://en.wikipedia.org/wiki/Cueva de los Verdes">Wikipedia</a>]]></description>                    <LookAt>                        <longitude>-13.4388888888889</longitude>                        <latitude>29.1611111111111</latitude>                        <altitude>0</altitude>                        <range>20000</range>                        <tilt>0</tilt>                        <heading>0</heading>                    </LookAt>                    <styleUrl>#nature</styleUrl>                    <Point>                        <coordinates>-13.4388888888889,29.1611111111111,0</coordinates>                    </Point>                </Placemark>            </Folder>            <Folder>                <name>Switzerland</name>                <visibility>0</visibility>                <Placemark>                    <name>Wildkirchli</name>                    <visibility>0</visibility>                    <description><![CDATA[<a href="http://en.wikipedia.org/wiki/Wildkirchli">Wikipedia</a>]]></description>                    <LookAt>                        <longitude>9.407999999999999</longitude>                        <latitude>47.282</latitude>                        <altitude>0</altitude>                        <range>20000</range>                        <tilt>0</tilt>                        <heading>0</heading>                    </LookAt>                    <styleUrl>#nature</styleUrl>                    <Point>                        <coordinates>9.407999999999999,47.28199999999999,0</coordinates>                    </Point>                </Placemark>            </Folder>            <Folder>                <name>Ukraine</name>                <visibility>0</visibility>                <Placemark>                    <name>Near Caves</name>                    <visibility>0</visibility>                    <description><![CDATA[<a href="http://en.wikipedia.org/wiki/Near Caves">Wikipedia</a>]]></description>                    <LookAt>                        <longitude>30.5614</longitude>                        <latitude>50.434</latitude>                        <altitude>0</altitude>                        <range>20000</range>                        <tilt>0</tilt>                        <heading>0</heading>                    </LookAt>                    <styleUrl>#nature</styleUrl>                    <Point>                        <coordinates>30.5614,50.434,0</coordinates>                    </Point>                </Placemark>            </Folder>            <Folder>                <name>United Kingdom</name>                <visibility>0</visibility>                <Placemark>                    <name>Chislehurst Caves</name>                    <visibility>0</visibility>                    <description><![CDATA[<a href="http://en.wikipedia.org/wiki/Chislehurst Caves">Wikipedia</a>]]></description>                    <LookAt>                        <longitude>0.0598598055555556</longitude>                        <latitude>51.4072638055556</latitude>                        <altitude>0</altitude>                        <range>20000</range>                        <tilt>0</tilt>                        <heading>0</heading>                    </LookAt>                    <styleUrl>#nature</styleUrl>                    <Point>                        <coordinates>0.0598598055555556,51.40726380555559,0</coordinates>                    </Point>                </Placemark>                <Placemark>                    <name>Cox's cave</name>                    <visibility>0</visibility>                    <description><![CDATA[<a href="http://en.wikipedia.org/wiki/Cox's cave">Wikipedia</a>]]></description>                    <LookAt>                        <longitude>-2.76903</longitude>                        <latitude>51.28171</latitude>                        <altitude>0</altitude>                        <range>20000</range>                        <tilt>0</tilt>                        <heading>0</heading>                    </LookAt>                    <styleUrl>#nature</styleUrl>                    <Point>                        <coordinates>-2.76903,51.28171,0</coordinates>                    </Point>                </Placemark>                <Placemark>                    <name>Fairy Cave Quarry</name>                    <visibility>0</visibility>                    <description><![CDATA[<a href="http://en.wikipedia.org/wiki/Fairy Cave Quarry">Wikipedia</a>]]></description>                    <LookAt>                        <longitude>-2.49214</longitude>                        <latitude>51.22592</latitude>                        <altitude>0</altitude>                        <range>20000</range>                        <tilt>0</tilt>                        <heading>0</heading>                    </LookAt>                    <styleUrl>#nature</styleUrl>                    <Point>                        <coordinates>-2.49214,51.22592000000001,0</coordinates>                    </Point>                </Placemark>                <Placemark>                    <name>Lud's Church</name>                    <visibility>0</visibility>                    <description><![CDATA[<a href="http://en.wikipedia.org/wiki/Lud's Church">Wikipedia</a>]]></description>                    <LookAt>                        <longitude>-2.02</longitude>                        <latitude>53.1866666666667</latitude>                        <altitude>0</altitude>                        <range>20000</range>                        <tilt>0</tilt>                        <heading>0</heading>                    </LookAt>                    <styleUrl>#nature</styleUrl>                    <Point>    ![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature(Wisconsin)![CDATA[(Wisconsin)]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature![CDATA[]]#nature(cave)![CDATA[(cave)]]#nature![CDATA[]]#nature![CDATA[]]#natureklzzwxh:27811/styleUrlklzzwxh:27812klzzwxh:29198klzzwxh:27813klzzwxh:27814klzzwxh:27815klzzwxh:27816klzzwxh:27817klzzwxh:27818klzzwxh:27819klzzwxh:27820klzzwxh:27821klzzwxh:27822klzzwxh:27823klzzwxh:27824klzzwxh:27825klzzwxh:27826klzzwxh:27827 klzzwxh:27828Pointklzzwxh:27829klzzwxh:29199klzzwxh:27830klzzwxh:27831klzzwxh:27832klzzwxh:27833klzzwxh:27834klzzwxh:27835klzzwxh:27836klzzwxh:27837klzzwxh:27838klzzwxh:27839klzzwxh:27840klzzwxh:27841klzzwxh:27842klzzwxh:27843klzzwxh:27844klzzwxh:27845klzzwxh:27846klzzwxh:27847klzzwxh:27848 klzzwxh:27849coordinatesklzzwxh:27850-98.16133055555559,22.9933472222222,0klzzwxh:27851/coordinatesklzzwxh:27852klzzwxh:29200klzzwxh:27853klzzwxh:27854klzzwxh:27855klzzwxh:27856klzzwxh:27857klzzwxh:27858klzzwxh:27859klzzwxh:27860klzzwxh:27861klzzwxh:27862klzzwxh:27863klzzwxh:27864klzzwxh:27865klzzwxh:27866klzzwxh:27867 klzzwxh:27868/Pointklzzwxh:27869klzzwxh:29201klzzwxh:27870klzzwxh:27871klzzwxh:27872klzzwxh:27873klzzwxh:27874klzzwxh:27875klzzwxh:27876klzzwxh:27877klzzwxh:27878klzzwxh:27879klzzwxh:27880 klzzwxh:27881/Placemarkklzzwxh:27882klzzwxh:29202klzzwxh:27883klzzwxh:27884klzzwxh:27885klzzwxh:27886klzzwxh:27887klzzwxh:27888klzzwxh:27889 klzzwxh:27890/Folderklzzwxh:27891klzzwxh:29203klzzwxh:27892klzzwxh:27893klzzwxh:27894 klzzwxh:27895/Folderklzzwxh:27896klzzwxh:29204klzzwxh:27897/Documentklzzwxh:27898klzzwxh:29205klzzwxh:27899/kmlklzzwxh:27900

         
    • I did couple of tests, and it looks like while the notepad or excel are interpreting certain special characters as ?, the underlying value is still correct. Try opening that CSV file in the web browser, and you will see that the special characters are encoded properly. So, you might want to change the setting in your editor to display UTF-8 charset to see if that helps.

       
    • I think I can write a fix for this.... I will save the file as UTF-8 encoded directly, this should fix the problem.... but before I do so, I want to make sure that Garmin GPS does handle a UTF-8 encoded CSV file, and Google Earth handles a UTF-8 KML file.

       
      • michelle evans
        michelle evans
        2008-08-14

        Sounds great.  Thanks for checking into this.  I'm going to push the file through on my end and hope it's displayed correctly at it's final destination and the hyperlinks are not broken.