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

Re^5: Yet another Encoding issue...

by Danny (Chaplain)
on Jun 01, 2024 at 22:02 UTC ( [id://11159748]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Yet another Encoding issue...
in thread Yet another Encoding issue...

By the way, depending on what charset you are specifying in your html you may get problems. For example, the little CGI script:
#!/bin/bash echo "Content-Type: text/html" echo "" perl -we 'use Encode; $c = encode("UTF-8", "é"); $dc = decode("UTF-8", + $c); print "\$c = $c \$dc = $dc\n"'
displays as: $c = é $dc = é

But if you fix the encoding like:

#!/bin/bash echo "Content-Type: text/html; charset=UTF-8" echo "" perl -we 'use Encode; $c = encode("UTF-8", "é"); $dc = decode("UTF-8", + $c); print "\$c = $c \$dc = $dc\n"'
it displays as: $c = é $dc = é

Replies are listed 'Best First'.
Re^6: Yet another Encoding issue...
by Bod (Parson) on Jun 01, 2024 at 22:06 UTC

    I'm using UTF-8

    Content-type: text/html; charset=UTF-8 <html> <meta charset="UTF-8">

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2025-06-18 09:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.