diff --git a/data/test_data/gpx/export_test.gpx b/data/test_data/gpx/export_test.gpx
index c6c43ad644..e4ad3c1d3d 100644
--- a/data/test_data/gpx/export_test.gpx
+++ b/data/test_data/gpx/export_test.gpx
@@ -8,6 +8,10 @@
Point 1
Point 1
+
+ <&"]]>
+ <&"]]>
+
Some random route
@@ -32,4 +36,13 @@
+
+ <&"]]>
+ <&"]]>
+
+
+ 123
+
+
+
\ No newline at end of file
diff --git a/kml/serdes_gpx.cpp b/kml/serdes_gpx.cpp
index d5fbb2660a..1d89cff465 100644
--- a/kml/serdes_gpx.cpp
+++ b/kml/serdes_gpx.cpp
@@ -508,8 +508,11 @@ void SaveBookmarkData(Writer & writer, BookmarkData const & bookmarkData)
if (!name)
name = GetDefaultLanguage(bookmarkData.m_name); // Original POI name stored when bookmark was created.
if (name)
- writer << kIndent2 << "" << *name << "\n";
-
+ {
+ writer << kIndent2 << "";
+ SaveStringWithCDATA(writer, name.value());
+ writer << "\n";
+ }
if (auto const description = GetDefaultLanguage(bookmarkData.m_description))
{
writer << kIndent2 << "";
@@ -540,7 +543,17 @@ void SaveTrackData(Writer & writer, TrackData const & trackData)
writer << "\n";
auto name = GetDefaultLanguage(trackData.m_name);
if (name.has_value())
- writer << kIndent2 << "" << name.value() << "\n";
+ {
+ writer << kIndent2 << "";
+ SaveStringWithCDATA(writer, name.value());
+ writer << "\n";
+ }
+ if (auto const description = GetDefaultLanguage(trackData.m_description))
+ {
+ writer << kIndent2 << "";
+ SaveStringWithCDATA(writer, description.value());
+ writer << "\n";
+ }
if (auto const color = TrackColor(trackData); color != kDefaultTrackColor)
{
writer << kIndent2 << "\n" << kIndent4 << "";