Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: can't get rid of BOM from UTF-8 webpage

by Anonymous Monk
on May 20, 2012 at 08:15 UTC ( #971471=note: print w/replies, xml ) Need Help??

in reply to can't get rid of BOM from UTF-8 webpage

Hi :)

My second question is why Perl insists on keeping the BOM and printing it later

Because it would be insane to throw it away without being told to throw it away.

I would have expected it to be stripped during the initial read of the text file, since it's just packaging, and omitted in Perl's internal character representation.

Besides not being mere packaging it isn't "omitted"; Your expectations is wrong.

Overall, though, I'd like to learn where to fix the problem. Do I configure Windows differently? Do I read the text file differently in Perl? Or do I just print things differently in Perl? Any insights or suggestions will be greatly appreciated.

for cmd.exe change fonts, I read fonts are responsible for not showing BOM

or try PowerShell, I hear that thing is unicode by default, so it ought to come with fonts that know to hide BOM

or from perl, strip the bom , say by using :encoding(UTF-8):via(File::BOM), and/or skip printing BOM when -t Filehandle is opened to a tty (tty means console, cmd.exe )

I've seen lots of suggestions ...

Next time, include those links in your post :)

FWIW, Content-type is not charset

FWIW, utf8 is not UTF-8, the difference could be important

BUT, FWIW, you shouldn't specify charset (utf8 or UTF-8) to decoded_content, that is webservers job , it should just work already

My first question is why the CMD prompt isn't handling the BOM correctly,

seems to me something on MSDN would answer that :p

  • Comment on Re: can't get rid of BOM from UTF-8 webpage

Replies are listed 'Best First'.
Re^2: can't get rid of BOM from UTF-8 webpage
by BeneSphinx (Sexton) on May 20, 2012 at 20:25 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://971471]
[oiskuu]: yergh, <code> tags... [$top_height .. $node_height]
[Eily]: Discipulus by demonstrate I suppose you mean simulate with perl?
[Eily]: the demonstration itself is fairly easy. The number of paths on a node is the sum of the numbers of paths to the two nodes above (or one node above on the edges of the triangle)
[Eily]: since the value of a node is also the sum from the two nodes above, you just have to demonstrate that the equality is true at the top of the triangle
[Discipulus]: yes Eily, thanks oiskuu but i dont get it.. ;=( maybe I'll ask a SOPW
[LanX]: all combinations with same amount of left and right?
[Eily]: if you want to store in a structure with the coordinates as key, arrays might do, since the keys are going to be 0..n
[LanX]: (Pascale path)
[Eily]: paths like that
[Discipulus]: yes Eily++ (very keen) I want to integrate my project with a 17th experiments. I want to colorize in sequence all paths

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2018-03-19 11:16 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (239 votes). Check out past polls.