Skip to content

Migrate EscapeStrForCSV() away from C-style strings#870

Draft
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_943378787
Draft

Migrate EscapeStrForCSV() away from C-style strings#870
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_943378787

Conversation

@copybara-service

Copy link
Copy Markdown

Migrate EscapeStrForCSV() away from C-style strings

Currently EscapeStrForCSV() assumes C-style strings, which causes embedded NULs to be assumed and treated specially. It also doesn't add the surrounding quotes, which causes redundant work for a lot of callers.

This change introduces a new QuoteStrForCSV() function for safe strings as a substitute, which also adds surrounding quotes. The existing EscapeStrForCSV() will be removed once all users are migrated to this new API.

Currently EscapeStrForCSV() assumes C-style strings, which causes embedded NULs to be assumed and treated specially. It also doesn't add the surrounding quotes, which causes redundant work for a lot of callers.

This change introduces a new QuoteStrForCSV() function for safe strings as a substitute, which also adds surrounding quotes. The existing EscapeStrForCSV() will be removed once all users are migrated to this new API.

PiperOrigin-RevId: 943378787
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant