Recent

Author Topic: C-Style escaped stings  (Read 539 times)

peardox

  • Jr. Member
  • **
  • Posts: 70
C-Style escaped stings
« on: October 01, 2020, 04:58:12 pm »
Yes, I've looked extensively through the docs but for the life of me can't find something that'll properly escape strings.

This is something I usually want to do for quick export for further processing, e.g. export a CSV of a load of data I'll later transfer to a server and load into a DB via PHP

I want to be able to properly handle data that may already be escaped (or not) so, as a simple example...

"hello word" => \"hello world\"

Unicode is also a concern so \uXXXX is handled properly

I've come across some very naughty data that is as bad as a log with embedded escaped sequences (this can be a nightmare)


jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: C-Style escaped stings
« Reply #1 on: October 01, 2020, 05:25:17 pm »
Look at the fpjson unit.
It has a jsontostring that handles esc
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018