SPUG: Stupid Ascii question

Can Subaykan cansubaykan at hotmail.com
Thu Aug 15 13:18:57 CDT 2002


If the data comes from a variety of sources (like from users who might have 
copy&pasted text from word processor documents etc.) the content itself 
might include some weird non-printing ascii characters.  With any bad luck, 
some may include the character you chose as the separator.

Maybe some kind of tag you can identify like <SEP> ?

ASCII stupid question, get a stupid ANSI  ;)


----Original Message Follows----
From: "Peter Darley" <pdarley at kinesis-cem.com>
To: "Dan Ebert" <mathin at mathin.com>
CC: "SPUG" <spug-list at pm.org>
Subject: RE: SPUG: Stupid Ascii question
Date: Thu, 15 Aug 2002 10:55:58 -0700

Dan,
	I'd like to make sure that it can handle any normal (readable) text, since
I don't know what might be stored in the future.
Thanks,
Peter Darley

-----Original Message-----
From: Dan Ebert [mailto:mathin at mathin.com]
Sent: Thursday, August 15, 2002 10:31 AM
To: Peter Darley
Cc: SPUG
Subject: Re: SPUG: Stupid Ascii question



I have often used a separator like :::: (four colons), since the chances
of that occuring in the data fields I wanted to parse was slim to none.
That way you wouldn't have to worry about using non-printable chars.  It
does take up more bytes than a single char though.

Dan.


On Thu, 2002-08-15 at 09:54, Peter Darley wrote:
 > Friends,
 > 	I am working with database stuff and I want to store deleted database
 > records, so there's a history of what was in the database.  I have chosen
to
 > do this by having my front end app, written in Perl, put all the field
names
 > and values into a single string separated by a non-printing Ascii
character
 > which I can just do a split() on later to return a hash of the record,
which
 > is exactly what I would get if I did a fetchrow_hashref() on the original
 > record.
 > 	My question is this; what non-printing Ascii character can I use for
this?
 > I wanted to use chr(0), the ascii null, but postgresql or DBD::Pg or DBI
or
 > something chokes on it.  I went with chr(31) which is described as 'unit
 > separator'.  I'm worried that there may be some unexpected interaction
with
 > file systems or something that I'm unaware of, so I thought I'd ask 
y'all.
 > Thanks,
 > Peter Darley
 >
 >
 >  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
-
 >      POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
 >       Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
 >   Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 >  For daily traffic, use spug-list for LIST ;  for weekly, 
spug-list-digest
 >      Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org
 >
--
Dan Ebert      <mathin at mathin.com>
----------------------------------------------------------
"If you're right 90% of the time, why quibble about the remaining 3%?"


  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
       Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
   Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
  For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
      Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org




_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org




More information about the spug-list mailing list