Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^3: Malformed UTF-8 character

by moritz (Cardinal)
on Apr 30, 2011 at 13:51 UTC ( [id://902201]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Malformed UTF-8 character
in thread Malformed UTF-8 character

It seems you don't really understand character encodings. Try reading this article get the basics.

The line use utf8; tells Perl that your script is stored in UTF-8, but it is not. Your editor did not save it as UTF-8, but rather as another encoding, likely Latin-1.

So either don't tell Perl that the file is stored in UTF-8 when it is not, or do store the file in UTF-8 (and use an editor which properly supports UTF-8).

Replies are listed 'Best First'.
Re^4: Malformed UTF-8 character
by Steve_BZ (Chaplain) on Apr 30, 2011 at 19:59 UTC

    Hi Moritz,

    I think you're right. I didn't understand, although I'm already following much of the advice in the your article.

    Interestingly, I was already using utf-8 encoding in all my files except this one. I so rarely have to do anything to the filesave default, that I forgot they were there. In fact both the fixes suggested here worked (correcting the file encoding and inserting  in front of the degrees sign).

    Thanks for everything

    Regards

    Steve

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (10)
As of 2024-04-18 08:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found