homepage Welcome to WebmasterWorld Guest from 54.204.73.126
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Hardware and OS Related Technologies / Website Technology Issues
Forum Library, Charter, Moderators: phranque

Website Technology Issues Forum

    
Macintosh Text Problems
How do I rid weird characters?
knighty

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 767 posted 11:46 am on Feb 27, 2002 (gmt 0)

I develop a news page using PHP & MYSQL, I import a CSV file (from the news source) but get a lot of strange characters where apostrophes etc. are supposed to be.

Is there some way of getting rid of/filtering these out?

For example where apostrophes should be im getting an O with 2 dots above it.

 

jatar_k

WebmasterWorld Administrator jatar_k us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 767 posted 7:45 pm on Feb 27, 2002 (gmt 0)

do you process the file before you insert it?

I was looking at php.net for a stripping or converting function. you could try something like htmlspecialchars() it might read them right and the dump them into the DB properly and then if you get them and show them in HTML they might come up right but this is a shot in the dark.

when I got files from a PC I used to run a BBedit script I have to convert the PC chars to Mac but that doesn't really help.

If you have a set of chars that you know are wrong and what they come out as you could parse the files on the way in and use regex to replace them.

EliteWeb

WebmasterWorld Senior Member eliteweb us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 767 posted 8:03 pm on Feb 27, 2002 (gmt 0)

Depends on the text editor. Try a different one :)

GoV

10+ Year Member



 
Msg#: 767 posted 5:34 am on Mar 4, 2002 (gmt 0)

Hey there...

As a Mac developer myself, I know that it does depend on your text editor. If you are editing any server scripts you need to use a safe text editor or script editor.

For my Perl scripts, SQL, Java and so on - Adobe GoLive will open any of these and allow for safe editing - without the added zeros and such that your speaking about.

These also are great:
MS Word
Mac Perl [macperl.org...]

Mac Simple Text by the way is not the best editor on earlier OS 9. But Simple Text for OS X is a good bet.. just make sure to set to plain text and not rich text (RTF) as you know Mac OS X is Unix base (grin) so your scripts should be easier to edit there.

Enjoy and hope this was a help.
~GoV

knighty

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 767 posted 9:05 am on Mar 4, 2002 (gmt 0)

thanks for the respones.

The problem is that when I open the CSV in Excel it all seems fine, I save it as a tab delimeited TXT file and import it onto MYSQL DB but then as soon as I view the output - it goes pear shaped.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Website Technology Issues
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved