Author Topic: apostrophe in csvupdate  (Read 3692 times)

0 Members and 1 Guest are viewing this topic.

Offline shlomit

  • Hero Member
  • *****
  • Posts: 117
apostrophe in csvupdate
« on: September 18, 2012, 07:29:25 AM »
when a user update his record with the csvupdate.pl and the text contains 1 apostrophe (like intch - 3' for example) all the text after it just disappear from the data base in this record.

please help, it drives me nuts ):

thanks

shlomit.

Offline MrG

  • Full Member
  • ***
  • Posts: 51
Re: apostrophe in csvupdate
« Reply #1 on: September 18, 2012, 03:08:31 PM »
shlomit;

I'm new to this also, but I just tried putting in what you said in a text field in my temporary database, and everything worked fine. I am using the csvxtra set of files.

I put in the following .....

this is a test' to see if I loose after the apostrophe mark

I'll even try the 3' to see what happens

***********************************

Didn't loose any text when I saved.

Is your field a text field, and/or have you made any changes to the update script?

Rich


.

Offline shlomit

  • Hero Member
  • *****
  • Posts: 117
Re: apostrophe in csvupdate
« Reply #2 on: September 18, 2012, 03:18:24 PM »
Hi Rich

thanks for your answer....

I did not made any changes to the script but I took Jason suggestion some time ago to put html editor for the users to update their ads like in this forum ...., and this is the reason, I think. i forgot to mention that.

Shlomit
« Last Edit: September 18, 2012, 03:20:03 PM by shlomit »

Offline MrG

  • Full Member
  • ***
  • Posts: 51
Re: apostrophe in csvupdate
« Reply #3 on: September 18, 2012, 05:35:14 PM »
Hi Shlomit;

I'm so new to this script that I haven't messed with the wysiwyg editor yet so I can't say whether it's the culprit or not. You may want to try removing the coding in your update form, if you're using one that you made, for a short while just to see if that is the problem.

That would be my suggestion. Jason or Rob may have another.

You may also want to visit the wysiwyg editors website and put a question in to them regarding the problem.

Rich


.

Offline Jason

  • Administrator
  • Hero Member
  • *****
  • Posts: 1018
    • slipdex
Re: apostrophe in csvupdate
« Reply #4 on: September 18, 2012, 06:34:07 PM »
Hi Shmolit,

If you are using the WYSIWYG editor I suggested I'm not sure what the cause could be. To test I would recommend looking at the raw database data to see if the data is actually missing or if it's just not displaying. If it is missing I would try removing the code for the WYSIWYG editor an trying it as a text area jut to rule out a possible script issue. I know that the editor works with csv update because I use it in my project. It does seem to me that apostrophes caused an issue somewhere else at one point but I can't recall exactly.

Jason
Founder of www.slipdex.com

Offline shlomit

  • Hero Member
  • *****
  • Posts: 117
Re: apostrophe in csvupdate
« Reply #5 on: October 06, 2012, 02:50:06 PM »
Hi Rich and Jason

after investigating the issue, it seems that wusiwyg is casing this.

i will try to ask them. anyway the idea to update ads with this script is wonderful....

thanks

shlomit
« Last Edit: October 06, 2012, 02:51:45 PM by shlomit »

Offline shlomit

  • Hero Member
  • *****
  • Posts: 117
Re: apostrophe in csvupdate
« Reply #6 on: October 08, 2012, 09:39:28 PM »
i am back with no success.

after customers submitting records (classified ads) to the database in a web forms, using csvwrite.pl , i have to edit them to correct spellings etc, etc...

I am using a form to update records in this database, which works with the csvupate.pl (till lately i used the regular csvedit.pl script to edit record. i enclosed to the text area the WYSIWYG editor. in case there are single quote in the text i have a problem. just took the editor off , to examine it, and the problem still there. so i think it is something ith the csvupdate.pl...  i tried to update one of my records without the editor. this record has single quote in some words. e.i   - j'ust an e'xample.. after submitting the form i get this - jt an emple. the script works ok with double quoates but not in words with single quote.

mope than this - i entered the record now via the csvupdate.pl script itself (http:xxx/csv/csvupdate.pl) and just saved the record... again... text after the single quote gone...

just to mention - if i edit this record with the csvedit.pl script (without any form),  it looks fine.
i was looking here over the form for a solution.
there is one  article which may talking about the same problem

http://www.ezscriptingforums.com/index.php?topic=77.msg259#msg259

 hack was sent to Aaron so i could not test it.

i could not find anything else.

thanks

shlomit




« Last Edit: October 08, 2012, 09:46:20 PM by shlomit »

Offline Jason

  • Administrator
  • Hero Member
  • *****
  • Posts: 1018
    • slipdex
Re: apostrophe in csvupdate
« Reply #7 on: October 10, 2012, 05:49:37 AM »
Hi Shlomit,

Is it possible to try this ourselves and see the results? The quote issue was strictly from the csvedit script if I remember correctly. Unfortunately with Aaron not on the forum and Jan passing away we cannot get that particular hack to see the code. I'd like to see what results from my own input as I have tested this with my setup and do not get the same results.

Jason
Founder of www.slipdex.com

Offline shlomit

  • Hero Member
  • *****
  • Posts: 117
Re: apostrophe in csvupdate
« Reply #8 on: October 10, 2012, 09:36:58 AM »
Hi Jason. sorry to hear about Jan
when editing record in the csvedit.pl everything is ok... it is only with the update script. If i can recall it did not happend with the 2005 csvupdate.pl  version. it started when i changed the script to  2006 version
and it does not happen either in csvwrite.pl - 2005 / 2006 versions

i took a very old ad so you can play with it. no one will see it. it is in Hebrew though

this is the ad -
http://www.israel.agrisupportonline.com/drushim/csv/csvread.pl?show=1774&mytemplate=tp2

you can update it here -
http://www.israel.agrisupportonline.com/drushim/csv/csvread.pl?show=1774&mytemplate=tp38

and see it on the first link

i have put some single quates including your name - Jason is ג'ייסון
we have many words with sing quates so it is very annoying to go the the edit script and change it back to look ok

if you need more information please let me know.

thanks !
« Last Edit: October 10, 2012, 09:59:29 AM by shlomit »

Offline shlomit

  • Hero Member
  • *****
  • Posts: 117
Re: apostrophe in csvupdate
« Reply #9 on: October 10, 2012, 01:44:42 PM »
Jason, please read my previous mail, but i think i see something which can give an idea. maybe what you wrote in your answer

we have 2 listing for classified ads. the one who makes problem is as follows -

versions
------------
edit - 2006
read - 2006
update - 2006
write - 2006

on other listing i just realized there is no problem with the single qute when you update record.

versions
-----------
edit - 2005
read - 2005
update - 2006
write - 2006

shlomit

Offline Rob

  • Hero Member
  • *****
  • Posts: 201
Re: apostrophe in csvupdate
« Reply #10 on: October 10, 2012, 04:05:05 PM »
Hi Shlomit,

Is everything after the apostrophe removed up to the next separator in your database?  OR is the remainder of the record removed after the apostrophe up to the next record in your database including the separators?  In other words are any of the separators being removed from the database?   

If you can PM me a copy of the script that's giving you the issue I'll take a look at the code and see if I can come up with a hack for you. 

Like Jason, I also performed a test and I can't seem to replicate the same undesired result.   


Rob
« Last Edit: October 10, 2012, 04:11:30 PM by Rob »

Offline shlomit

  • Hero Member
  • *****
  • Posts: 117
Re: apostrophe in csvupdate
« Reply #11 on: October 10, 2012, 04:30:38 PM »

Hi Rob

no, not everything . just the 2 letter after the the apostrph. for example - if the word is  - l'APOSTROPH ETC ETc...what left is
lPOSTROPH ETC ETc... it drop out the letter after the apostpho but eveything after that remain...

i will PM you a copy of the script. thanks

Shlomit

Offline Rob

  • Hero Member
  • *****
  • Posts: 201
Re: apostrophe in csvupdate
« Reply #12 on: October 10, 2012, 04:39:40 PM »
Hi Shlomit,

When the record is written to the database how is the apostrophe written?  Is it the actual apostrophe or the ASCII character.  e.g. '

Rob
« Last Edit: October 10, 2012, 04:55:48 PM by Rob »

Offline shlomit

  • Hero Member
  • *****
  • Posts: 117
Re: apostrophe in csvupdate
« Reply #13 on: October 10, 2012, 04:49:11 PM »
Hi Rob

yes, i checked it now in the  database.txt file - it look like this -  '

did you get my PM ? i wrote you that there is a limit of letter and the script cannot be copies there, but i do not see any copy of my message to you here in my box

shlomit


Offline Rob

  • Hero Member
  • *****
  • Posts: 201
Re: apostrophe in csvupdate
« Reply #14 on: October 10, 2012, 05:36:20 PM »
Hi Shlomit,
This hack should resolve the disappearing apostrophe issue.   

Within your csvupdate script

Change:

$FORM{$key} =~ s/'(..)/pack("c",hex($1))/ge; 

To:

$FORM{$key} =~ s/%(..)/pack("c",hex($1))/ge;



Rob
« Last Edit: October 10, 2012, 09:17:31 PM by Rob »