diff --git a/XstFile.cs b/XstFile.cs index c994ab2..e54ec88 100644 --- a/XstFile.cs +++ b/XstFile.cs @@ -515,9 +515,11 @@ private void AddCsvValue(StringBuilder sb, string value, ref bool hasValue) if (value != null) { - // Multilingual characters should be quoted, so We will just quote all values, + // Multilingual characters should be quoted, so we will just quote all values, // which means we need to double quotes in the value - var val = value.Replace("\"", "\"\""); + // Excel cannot cope with Unicode files with values containing + // new line characters, so remove those as well + var val = value.Replace("\"", "\"\"").Replace("\r\n", "; ").Replace("\r", " ").Replace("\n", " "); sb.Append("\""); sb.Append(EnforceCsvValueLengthLimit(val)); sb.Append("\"");