4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Don't know the format of the text code
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
kepler
Junior WebHelper
Junior WebHelper


Joined: 08 Feb 2002
Posts: 37

PostPosted: Wed Nov 05, 2003 10:31 am (14 years, 1 month ago) Reply with QuoteBack to Top

Hi,

I have a database with several names that was in Unix format. The name Agrochão appears as Agrochão. Does anyone knows what kind of code is this? Unicode, UTF?

I want to convert all the names that appear in the second format name to the first (ansi).

Please, someone reply to this message as soon as possible.

Best regards,

Kepler
OfflineView User's ProfileFind all posts by keplerSend Personal Message
kepler
Junior WebHelper
Junior WebHelper


Joined: 08 Feb 2002
Posts: 37

PostPosted: Wed Nov 05, 2003 11:40 am (14 years, 1 month ago) Reply with QuoteBack to Top

Hi again,

I think is UTF-o encoding. Is there a convertor from UTF-8 to ansi - free - available in the web?

Best regards,

Kepler
OfflineView User's ProfileFind all posts by keplerSend Personal Message
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Thu Nov 06, 2003 8:08 pm (14 years, 1 month ago) Reply with QuoteBack to Top

yeah, it'll almost certainly be UTF-8. I'm not sure of any online tools, give me 10 mins and I'll make you one Smile

________________________________
It's turtles all the way down...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Thu Nov 06, 2003 8:21 pm (14 years, 1 month ago) Reply with QuoteBack to Top

ok, I thought about what would be the best way to do this, and I think this will be easiest:
Code:
<?php
$file = '/home/user/file.txt';
print system('unix2dos '.$file);
include($file);
?>

simply upload the file you wish to convert to somewhere in your webspace, and change $file so that it contains the full path to the file. The script will convert the file, and display it to you. This script does assume your server is running a unix-like operating system, and has PHP and the unix2dos utility installed. Also, unless your server is running phpsuexec (which is most probably isn't) you'll need to make the text file world-writable (chmod 666).

Of course, if you have shell access to a unix machine you can login and use unix2dos manually.

________________________________
It's turtles all the way down...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
kepler
Junior WebHelper
Junior WebHelper


Joined: 08 Feb 2002
Posts: 37

PostPosted: Thu Nov 06, 2003 8:32 pm (14 years, 1 month ago) Reply with QuoteBack to Top

Hi,

The solution is good - the only problem is that the file has 800 MB.

Best regards,

kepler
OfflineView User's ProfileFind all posts by keplerSend Personal Message
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




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 vote in polls in this forum.


Page generation time: 0.052071 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme