Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Encode string to HTML

by Corion (Pope)
on Nov 01, 2013 at 14:50 UTC ( #1060771=note: print w/ replies, xml ) Need Help??


in reply to Re: Encode string to HTML
in thread Encode string to HTML

decodeing from utf-8 only helps if the source code is actually encoded as UTF-8. This may or may not be the case.

At least according to Wikipedia, likely encodings are also ISO 8859-3, ISO 8859-9 or Windows-1254, if guessing that &iuml is supposed to depict a Turkish letter.


Comment on Re^2: Encode string to HTML
Select or Download Code
Re^3: Encode string to HTML
by hippo (Curate) on Nov 01, 2013 at 15:06 UTC

    Indeed so - it is nigh on impossible to determine the encoding of a document from a single character, so the actual encoding of the source will only be known by gepebril69. UTF-8 seemed a reasonable first guess in this instance and it does produce the desired output for that one character.

Re^3: Encode string to HTML
by gepebril69 (Beadle) on Nov 01, 2013 at 15:27 UTC

    I've checked the template file and it is

    text/html; charset=utf-8

    Now I understand why I had a similar problem in the past with parsing files. Perl don't seem to auto detect this formatting. It will have a logical reason I guess

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2014-12-27 23:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (177 votes), past polls