Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use \n as delimiter #2274

Open
Chewy5639 opened this issue Jul 9, 2024 · 0 comments
Open

Cannot use \n as delimiter #2274

Chewy5639 opened this issue Jul 9, 2024 · 0 comments
Labels

Comments

@Chewy5639
Copy link

Describe the bug
Attempting to set CsvConfiguration.Delimiter to \n results in validation error:

The delimiter '
' cannot be a line ending. ('\r', '\n', '\r\n')

To Reproduce

var config = new CsvConfiguration(CultureInfo.InvariantCulture)
{
    Delimiter = "\n",
    NewLine = "~" //Some non line ending character
};

_csvReader = new CsvReader(reader, config);

Expected behavior
It appears that the CsvConfiguration.Validate method is checking against a hard coded array of line ending characters. The expected behaviour is to allow Delimiter to be \r, \n, or \r\n as long as NewLine is something different.

@Chewy5639 Chewy5639 added the bug label Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant