From: Niki Roo Date: Sat, 2 Apr 2016 12:57:38 +0000 (+0200) Subject: Fix: default FN should be trimmed X-Git-Tag: v1.1~7 X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=99f631de95f8b89bd716b8c4011308fc1aacaeaf;p=jvcard.git Fix: default FN should be trimmed --- diff --git a/src/be/nikiroo/jvcard/BaseClass.java b/src/be/nikiroo/jvcard/BaseClass.java index 026c5b4..9323376 100644 --- a/src/be/nikiroo/jvcard/BaseClass.java +++ b/src/be/nikiroo/jvcard/BaseClass.java @@ -450,20 +450,19 @@ public abstract class BaseClass> implements List { } /** - * Escape the given value to VCF standard. + * Unescape the given value from the VCF standard. * * @param value - * the value to escape + * the value to unescape * - * @return the escaped value + * @return the unescaped value */ protected String unescape(String value) { if (value == null) return null; return value.replaceAll("\\\\,", ",").replaceAll("\\\\;", ";") - - .replaceAll("\\\\n", "\n"); + .replaceAll("\\\\n", "\n"); } /** diff --git a/src/be/nikiroo/jvcard/launcher/Main.java b/src/be/nikiroo/jvcard/launcher/Main.java index f193be1..f96e558 100644 --- a/src/be/nikiroo/jvcard/launcher/Main.java +++ b/src/be/nikiroo/jvcard/launcher/Main.java @@ -429,7 +429,8 @@ public class Main { + trans(StringId.CLI_HELP_LANG)); System.out.println("\t--tui : " + trans(StringId.CLI_HELP_TUI)); System.out.println("\t--gui : " + trans(StringId.CLI_HELP_GUI)); - System.out.println("\t--noutf : " + trans(StringId.CLI_HELP_NOUTF_OPTION)); + System.out.println("\t--noutf : " + + trans(StringId.CLI_HELP_NOUTF_OPTION)); System.out.println("\t--config : " + trans(StringId.CLI_HELP_CONFIG)); System.out.println(); @@ -500,7 +501,7 @@ public class Main { Data name = contact.getPreferredData("FN"); if (name == null || name.getValue().length() == 0 || forceComputedFn) { - name.setValue(contact.toString(defaultFn, "")); + name.setValue(contact.toString(defaultFn, "").trim()); } } } catch (Exception e) {