Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re^2: Can Perl convert ISO-? | WIN-? | MAC-? to UTF-8?

by taint (Chaplain)
on May 23, 2013 at 06:21 UTC ( #1034877=note: print w/replies, xml ) Need Help??

in reply to Re: Can Perl convert ISO-? | WIN-? | MAC-? to UTF-8?
in thread Can Perl convert ISO-? | WIN-? | MAC-? to UTF-8?

Greetings choroba, and thank you for your reply.
My question is:
If I have a mass of (textual) files, that have mixed encoding(s) && line-endings,
aside from ICONV(1) | FILE(1), how can I unify them -- convert them all to
UTF-8 | UTF8?
Given what I do know about Perl, I should be able to slurp them, process
the contents, and spit them out as "unified" -- see UTF8 text files, all having the same line-endings.
Given that the files I'd be slurping, are of mixed "types", is there any way to process
them, so they all end up the same "type" when they're done?

I hope I was clearer || more concise this time. :)

Thanks again, for your response.


#!/usr/bin/perl -Tw
use perl::always;
my $perl_version = "5.12.4";
print $perl_version;
  • Comment on Re^2: Can Perl convert ISO-? | WIN-? | MAC-? to UTF-8?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1034877]
[Corion]: Meh. SQL window functions would even make pagination easy/trivial (but not performant), as rank() over (partition by user order by timestamp) / 10 as page would give me a page number for each item, with 10 items per page.
[Corion]: Of course, the query performance for "all items on page 10" is likely worse than rank() between 100 and 109 , but if that means I can write 15 lines of SQL instead of needing to think about how to partition things and how to encode the page size...
[Corion]: ... that would be nice. But alas, I'm currently tied to SQLite as minimum implementation, and it doesn't implement window functions :-(

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2018-03-22 12:15 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (274 votes). Check out past polls.