PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Sun Oct 25, 2020 6:12 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sat Mar 22, 2014 11:02 pm 
Offline
Forum Commoner

Joined: Thu Apr 09, 2009 11:16 pm
Posts: 80
I've got about 3000 text files encoded in ANSI (windows-1252) that I'd like to convert to UTF-8. I used UTFCast to do that, but now all my special characters are turning up wonky - smart quotes, emdashes, accented letters, and so on are either appearing as question marks or weird characters.

Is there any way for me to preserve those special characters while doing the conversion? There are way too many files for me to do this with a manual search and replace, especially since I won't know if I've fixed every instance of this unless I go through each file to check. Even if I stick to just the foreign-language files, there are probably at least a hundred.

Any help would be greatly appreciated, thanks!


Top
 Profile  
 
PostPosted: Sat Mar 22, 2014 11:22 pm 
Offline
Site Administrator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 13592
Location: New York, NY, US
From the Unix command line or any language with access to the standard C library you cat try iconv.

Command line: http://www.gnu.org/savannah-checkouts/g ... onv.1.html
PHP docs: http://www.php.net/manual/en/book.iconv.php

_________________
(#10850)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group