
October 9th, 2012, 11:14 PM
|
|
Registered User
|
|
Join Date: Jan 2011
Location: Strathmore, AB, Canada
Posts: 14
Time spent in forums: 2 h 54 m 43 sec
Reputation Power: 0
|
|
|
Making data 'safe' for writing to a flat file?
The search function is throwing a 500 error, so apologies if this is covered elsewhere.
I'm writing a small file that holds some user data and I want to ensure that I encode it so that I can read it back reliably.
A few pieces of data could contain ANY character that could be stored in a Perl string. Also, some of these strings could be very long.
Some example items that I would write to a file:
Quote: NAME=Natália Braga
CITY=São Paulo
AGE=25
MEMO=This is some text. It might contain newlines, quotation marks, diacritic marks, or any other "characters" that are legal to store in a perl string.\nHow can I safely convert these data items so that I can later read them back? |
|