New SAVE_TO option
[jvcard.git] / src / be / nikiroo / jvcard / parsers / AbookParser.java
index fc4df3613f2af8e34947712cdcb0860217b9d168..17080225b34cc5d9fa9cbc7c1a58fd69b5da8d6c 100644 (file)
@@ -110,10 +110,13 @@ public class AbookParser {
                        builder.append(notes);
                }
 
+               // abook format = one line per contact
+               String out = builder.toString().replace("\n", "\\n");
+
                // note: save as pine means normal LN, nor CRLN
-               builder.append('\n');
+               out = out + "\n";
 
-               return Arrays.asList(new String[] { builder.toString() });
+               return Arrays.asList(new String[] { out });
        }
 
        /**
@@ -153,7 +156,6 @@ public class AbookParser {
                        int startingBKey) throws IOException {
                for (String s : toStrings(contact, startingBKey)) {
                        writer.append(s);
-                       writer.append('\n');
                }
        }
 
@@ -171,7 +173,6 @@ public class AbookParser {
        public static void write(Appendable writer, Card card) throws IOException {
                for (String s : toStrings(card)) {
                        writer.append(s);
-                       writer.append('\n');
                }
        }
 }