Can you encode CR/LF in into CSV files?

前端 未结 4 1543
北海茫月
北海茫月 2020-11-27 15:51

Is it possible/legal to somehow encode CR/LF characters into a CSV file?

(as part of a CSV standard?)

If so how should i encode CR/LF?

4条回答
  •  抹茶落季
    2020-11-27 16:20

    I don't think it's part of the standard (if there even is one), but you could use standard C-style escaping, i.e. encode \r\n.

    Keep in mind, however, that if you do that you should also encode the escape character -- i.e. \ yields \ after decoding.

提交回复
热议问题