Link to home
Start Free TrialLog in
Avatar of IDEASDesign
IDEASDesign

asked on

Degrees symbol not translating correctly ( ý ??? ) when inserting into database!!

I've built a custom app for a client that has product import/export features.  The client can export a tab-delimited text file, .. import the file into excel, ... make changes, .. re-save, ... and then re-import the file into the database.

I am first retrieving the data from the uploaded tab-delimited text file using CFHTTP:

<CFHTTP URL="http://ww.mywebsiteurl.com/uploads/#FORM.the_filename#" METHOD="GET" NAME="MyQuery" DELIMITER="      " TEXTQUALIFIER=""></CFHTTP>

I then either insert a new record, or update an existing one, .. depending on whether or not the specfic product code already exists in the database.  

The problem that I'm having is that whenever the client includes the degrees symbol ( ie: ° ) in the file to be re-imported, .. the symbol is for whatever reason being converted to some other character ( ie: ý ) .  

Why is this happening, and how can it be corrected?  I suspect that the problem is with CFHTTP's inability to properly decipher the degrees symbol using the GET method, since I have a simple "modify products" section in the app's  adminsitration website which retains the degrees symbol without any problems when I modify a product description.  But I'm not sure how to confirm this just yet.  Anyone know what might be going on?

Thanks in advance,
 - yvan

Avatar of black0ps
black0ps
Flag of United States of America image

Do you have the ability to make modify the text file before cfhttp gets it? If you can, try and parse the file and do a replace for that degree symbol. Replace it with either &deg; or %C2%B0. I have problems with characters when the charset isn't encoded properly. You might want to try UTF-8 or ISO. (switch it up)

-- Ian
Avatar of IDEASDesign
IDEASDesign

ASKER

Actually, I was able to resolve the problem by adding  charset="iso-8859-1" to the CFHTTP tag.  I'd already tried the approach you suggested (thank you) - but as it turned out, it was an issue relating to the character encoding.

- yvan



How do I delete this question, considering that I've already found a solution on my own?

- yvan

Make a post in the help forum with a link to this topic.
Okay.  And where exactly is the "help" forum?

- yvan
ASKER CERTIFIED SOLUTION
Avatar of Lunchy
Lunchy
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial