]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
bug fix: improve behaviour for Excel import
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>
Tue, 19 May 2009 13:37:40 +0000 (13:37 +0000)
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>
Tue, 19 May 2009 13:37:40 +0000 (13:37 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@327 b3834d28-1941-0410-a4f8-b48e95affb8f

api/export_csv.php

index d9d824b49f5d9605973721a89e8fc8022b7ed045..2389642c1c7049967e7ed823f402aff274c55432 100644 (file)
@@ -17,18 +17,18 @@ else
 // Get the posts relevant to the passed-in variables.\r
 $bookmarks =& $bookmarkservice->getBookmarks(0, NULL, $userservice->getCurrentUserId(), $tag, NULL, getSortOrder());\r
 \r
-header("Content-Type: application/csv-tab-delimited-table");
+header("Content-Type: application/csv-tab-delimited-table;charset=UTF-8");
 header("Content-disposition: filename=exportBookmarks.csv");\r
 \r
 //columns titles
-echo 'url,title,tags,description';
+echo 'url;title;tags;description';
 echo "\n";\r
 \r
 foreach($bookmarks['bookmarks'] as $row) {\r
     if (is_null($row['bDescription']) || (trim($row['bDescription']) == ''))\r
         $description = '';\r
     else\r
-        $description = filter($row['bDescription'], 'xml');\r
+        $description = filter(str_replace(array("\r\n", "\n", "\r"),"", $row['bDescription']), 'xml');\r
 \r
     $taglist = '';\r
     if (count($row['tags']) > 0) {\r
@@ -39,7 +39,7 @@ foreach($bookmarks['bookmarks'] as $row) {
         $taglist = 'system:unfiled';\r
     }\r
 \r
-    echo '"'.filter($row['bAddress'], 'xml') .'","'. filter($row['bTitle'], 'xml') .'","'. filter($taglist, 'xml') .'","'. $description .'"';
+    echo '"'.filter($row['bAddress'], 'xml') .'";"'. filter($row['bTitle'], 'xml') .'";"'. filter($taglist, 'xml') .'";"'. $description .'"';
     echo "\n";\r
 }\r
 \r