Jump to content

Worked in Php4 now problems with Php5 (Leopard server)


Recommended Posts

Hi,

 

Fast background. We are a school board environment. We had a programmer build us a script that runs every night on a Apple 10.4 server (Php4) that interrogates our SQL server, takes info, format's it and then copies over to LDAP (OD). Since we are in Quebec, lots of entries have accents. The script was also used to strip the accents. We are now passing to Snow Leopard that runs Php5. I've got the scripts partially running but as soon as it meets an accent, it all stops and I get this error message:

 

iconv: (stdin):23:82: cannot convert

 

I look at at all scripts with textrangler and all are Unix and UTF-8. I wont post all the script but this first part doesnt pass:

 

StripAccents()

{

echo "$1" | tr "\351\311\350\310\352\312\353\313\356\316\357\317\364\324\366\326\371\331\373\333\374\334\340\300\342\302\344\304\347\307" "eEeEeEeEiIiIoOoOuUuUuUaAaAaAcC"

}

 

 

curl "http://myserver.ca:8080/imp_ldap/imp_ldap.php?Mode=ds_eleves&Annee=2009" > ImportEleves.txt

listToConvert=`cat ImportEleves.txt`

convertedList=`echo "$listToConvert" | iconv -f MAC -t Latin1`

StripAccents "$convertedList" > ImportEleves_fixed.txt

 

The ImportEleves.txt is complete then the ImportEleves_fixed.txt starts and stops at the first accent.

 

I'm realy lost in PHP.....need your help!

 

André

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.