Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

by Khen1950fx (Canon)
on May 23, 2013 at 06:04 UTC ( #1034875=note: print w/ replies, xml ) Need Help??


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

I think that you might need to use String::BOM.

#!/usr/bin/perl -l use strict; use warnings; use String::BOM qw(strip_bom_from_file); my $file = '/path/to/file'; print strip_bom_from_file($file);


Comment on Re: Can Perl convert ISO-? | WIN-? | MAC-? to UTF-8?
Download Code
Re^2: Can Perl convert ISO-? | WIN-? | MAC-? to UTF-8?
by taint (Chaplain) on May 23, 2013 at 06:26 UTC
    Greetings Khen1950fx , and thank you for your reply.
    That's good advice. But if I understand what you've offered, it would strip the BOM
    (ByteOrderMarker) from the file(s). While that was probably the case somewhere in their
    past. None of them appear to have one now.

    Thank you again, for your response

    --chris

    #!/usr/bin/perl -Tw
    use perl::always;
    my $perl_version = "5.12.4";
    print $perl_version;

      Thank you again, for your response

      Public service announcement

      Khen1950fx is a troll , you should ignore him
      he doesn't understand your question
      he doesn't even try to understand your question
      he scans your posts for at most three keywords, and then copy/pastes some code related to those keywords
      virtually never has anything do with the question

      Re: Perl with Swig C module not releasing memory ( old Khen1950fx announcement )

        Re^Public service announcement
        Thanks for the "Heads Up".

        --chris

        #!/usr/bin/perl -Tw
        use perl::always;
        my $perl_version = "5.12.4";
        print $perl_version;
Re^2: Can Perl convert ISO-? | WIN-? | MAC-? to UTF-8?
by Anonymous Monk on May 23, 2013 at 06:30 UTC

    I think that you might need to use String::BOM

    Why do you think that? Which portion of the OPs question is that supposed to solve?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1034875]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2014-12-28 06:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (178 votes), past polls