Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re^4: UTF-8 text files with Byte Order Mark

by Anonymous Monk
on Sep 30, 2011 at 18:30 UTC ( #928893=note: print w/replies, xml ) Need Help??

in reply to Re^3: UTF-8 text files with Byte Order Mark
in thread UTF-8 text files with Byte Order Mark

Thank you!!! This saved me a lot of trouble. I am also trying to strip out these UTF-8 byte order mark characters, which google docs puts in by default to downloaded text files. By the way I found that \x{FEFF} was not the same as \x{ef}\x{bb}\x{bf}
  • Comment on Re^4: UTF-8 text files with Byte Order Mark

Replies are listed 'Best First'.
Re^5: UTF-8 text files with Byte Order Mark
by ikegami (Pope) on Oct 01, 2011 at 21:53 UTC

    By the way I found that \x{FEFF} was not the same as \x{ef}\x{bb}\x{bf}

    Yeah, "\x{ef}\x{bb}\x{bf}" is the UTF-8 encoding of the BOM / U+FEFF / "\x{FEFF}".

      Please stop confusing. FEFF has nothing to do with UTF-8. This is a BOM for UTF-16 Big Endian-encoded files.

        This is a BOM for UTF-16 Big Endian-encoded files.

        You are mistaken. It's the BOM, period. It can be encoded using UTF-8 and UTF-16le just as easily as with UTF-16be.

        $ perl -MEncode -e'print encode("UTF-8", chr(0xFEFF))' | od -t x1 0000000 ef bb bf 0000003 $ perl -MEncode -e'print encode("UTF-16be", chr(0xFEFF))' | od -t x1 0000000 fe ff 0000002 $ perl -MEncode -e'print encode("UTF-16le", chr(0xFEFF))' | od -t x1 0000000 ff fe 0000002
        2B,2F,76,38,2DBOM encoded using UTF-7
        EF,BB,BFBOM encoded using UTF-8
        FE,FFBOM encoded using UTF-16be
        FF,FEBOM encoded using UTF-16le
        00,00,FE,FFBOM encoded using UTF-32be
        FF,FE,00,00BOM encoded using UTF-32le

        So you won't find FE,FF in a UTF-8 file, but just like in a UTF-16be file, you can find an encoded FEFF in a UTF-8 file.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://928893]
[Corion]: Once more, I'm looking for a sane client-side framework, but I guess these don't exist. Everything I look at either uses a weirdo home-grown templating language (like Angular in all its incarnations) or uses weirdo Javascript incarnations (like ...
[Corion]: ... Inferno.js, which uses ES2015) or uses some horrible amount of Javascript infrastructure before you can even render a single file.
[Corion]: I'd really like to create a dynamic frontend for my Google Keep clone, but so far, all the templating solutions seem to bring their own template language or require me to hand-code everything in (their own flavour of) Javascript. I'd like something ...
[Corion]: ... that can use templates from the HTML (via <script language="text/ template">... my template ...</script> and otherwise gets out of my way. But it seems that is not how the Javascript world is, currently :-/
[Corion]: I guess my question is, has anybody worked with React, Ember, Angular (v2, v4, v.whatever) or any other JS client-side dynamic rendering/virtual DOM thingie and found a simple, single-file solution like jQuery?

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (12)
As of 2017-03-27 19:00 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (321 votes). Check out past polls.