Emacs automatically adding BOM to XML fileEmacs: How to insert 'λ' instead of 'lambda' in Scheme mode?How to...

Was there ever a Kickstart that took advantage of 68020+ instructions that would work on an A2000?

Was Unix ever a single-user OS?

Point of the the Dothraki's attack in GoT S8E3?

Why is B♯ higher than C♭ in 31-ET?

Enumerate Derangements

How can I close a gap between my fence and my neighbor's that's on his side of the property line?

In a vacuum triode, what prevents the grid from acting as another anode?

In Avengers 1, why does Thanos need Loki?

Reconstruct a matrix from its traces

Theorem won't go to multiple lines and is causing text to run off the page

SQL Server Management Studio SSMS 18.0 General Availability release (GA) install fails

What does a yield inside a yield do?

How to 'Let Go' in Meditation?

Can I get a paladin's steed by True Polymorphing into a monster that can cast Find Steed?

What is the unit of the area when geometry attributes are calculated in QGIS?

Sub query result is 0

Catholic vs Protestant Support for Nazism in Germany

Are we obligated to aspire to be Talmidei Chachamim?

What was the state of the German rail system in 1944?

What are the differences between credential stuffing and password spraying?

What word means "to make something obsolete"?

What happens to the Time Stone

Selecting a secure PIN for building access

In Endgame, why were these characters still around?



Emacs automatically adding BOM to XML file


Emacs: How to insert 'λ' instead of 'lambda' in Scheme mode?How to create a Emacs file that looks/feels likes the Emacs start up page?Creating Emacs TAGS fileProcess a file that starts with a BOM (FF FE)Edit a file in several emacs sessionsEmacs shows octal escapes for some characters in a UTF-8 fileCan I have emacs automatically indent my whole code after it is all written?Open an emacs file from terminalHow to check if file has a BOM in utf-8 textemacs text mode UTF-8 characters






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







4















This appears to be related to this discussion but I have exactly the opposite use case. I do not wish to insert a BOM but emacs appears to be inserting one in XML mode (without even being in hexl-mode). I am using GNU Emacs 23.3.1.



I have the following XML file:



$ cat a.xml 
<?xml encoding="UTF-16"?><a/>
$ xxd a.xml
0000000: 3c3f 786d 6c20 656e 636f 6469 6e67 3d22 <?xml encoding="
0000010: 5554 462d 3136 223f 3e3c 612f 3e0a UTF-16"?><a/>.


The file does not contain a BOM as can be seen.
When I try to open it with emacs a.xml this is what I see:
enter image description here



When I then switch to hexl-mode it appears that a BOM has been inserted:
enter image description here



This happens even if I start Emacs with emacs -Q.










share|improve this question

























  • Does this happen if you start Emacs with emacs -q? If not, post your init file (~/.emacs or ~/.emacs.d/init.el). If it does, what about emacs -Q?

    – Gilles
    Mar 9 '15 at 22:59











  • @Gilles Chinese characters also appear with -q and -Q as well.

    – Marcus Junius Brutus
    Mar 9 '15 at 23:17


















4















This appears to be related to this discussion but I have exactly the opposite use case. I do not wish to insert a BOM but emacs appears to be inserting one in XML mode (without even being in hexl-mode). I am using GNU Emacs 23.3.1.



I have the following XML file:



$ cat a.xml 
<?xml encoding="UTF-16"?><a/>
$ xxd a.xml
0000000: 3c3f 786d 6c20 656e 636f 6469 6e67 3d22 <?xml encoding="
0000010: 5554 462d 3136 223f 3e3c 612f 3e0a UTF-16"?><a/>.


The file does not contain a BOM as can be seen.
When I try to open it with emacs a.xml this is what I see:
enter image description here



When I then switch to hexl-mode it appears that a BOM has been inserted:
enter image description here



This happens even if I start Emacs with emacs -Q.










share|improve this question

























  • Does this happen if you start Emacs with emacs -q? If not, post your init file (~/.emacs or ~/.emacs.d/init.el). If it does, what about emacs -Q?

    – Gilles
    Mar 9 '15 at 22:59











  • @Gilles Chinese characters also appear with -q and -Q as well.

    – Marcus Junius Brutus
    Mar 9 '15 at 23:17














4












4








4








This appears to be related to this discussion but I have exactly the opposite use case. I do not wish to insert a BOM but emacs appears to be inserting one in XML mode (without even being in hexl-mode). I am using GNU Emacs 23.3.1.



I have the following XML file:



$ cat a.xml 
<?xml encoding="UTF-16"?><a/>
$ xxd a.xml
0000000: 3c3f 786d 6c20 656e 636f 6469 6e67 3d22 <?xml encoding="
0000010: 5554 462d 3136 223f 3e3c 612f 3e0a UTF-16"?><a/>.


The file does not contain a BOM as can be seen.
When I try to open it with emacs a.xml this is what I see:
enter image description here



When I then switch to hexl-mode it appears that a BOM has been inserted:
enter image description here



This happens even if I start Emacs with emacs -Q.










share|improve this question
















This appears to be related to this discussion but I have exactly the opposite use case. I do not wish to insert a BOM but emacs appears to be inserting one in XML mode (without even being in hexl-mode). I am using GNU Emacs 23.3.1.



I have the following XML file:



$ cat a.xml 
<?xml encoding="UTF-16"?><a/>
$ xxd a.xml
0000000: 3c3f 786d 6c20 656e 636f 6469 6e67 3d22 <?xml encoding="
0000010: 5554 462d 3136 223f 3e3c 612f 3e0a UTF-16"?><a/>.


The file does not contain a BOM as can be seen.
When I try to open it with emacs a.xml this is what I see:
enter image description here



When I then switch to hexl-mode it appears that a BOM has been inserted:
enter image description here



This happens even if I start Emacs with emacs -Q.







emacs unicode






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 23 '17 at 12:40









Community

1




1










asked Mar 9 '15 at 15:52









Marcus Junius BrutusMarcus Junius Brutus

1,58892546




1,58892546













  • Does this happen if you start Emacs with emacs -q? If not, post your init file (~/.emacs or ~/.emacs.d/init.el). If it does, what about emacs -Q?

    – Gilles
    Mar 9 '15 at 22:59











  • @Gilles Chinese characters also appear with -q and -Q as well.

    – Marcus Junius Brutus
    Mar 9 '15 at 23:17



















  • Does this happen if you start Emacs with emacs -q? If not, post your init file (~/.emacs or ~/.emacs.d/init.el). If it does, what about emacs -Q?

    – Gilles
    Mar 9 '15 at 22:59











  • @Gilles Chinese characters also appear with -q and -Q as well.

    – Marcus Junius Brutus
    Mar 9 '15 at 23:17

















Does this happen if you start Emacs with emacs -q? If not, post your init file (~/.emacs or ~/.emacs.d/init.el). If it does, what about emacs -Q?

– Gilles
Mar 9 '15 at 22:59





Does this happen if you start Emacs with emacs -q? If not, post your init file (~/.emacs or ~/.emacs.d/init.el). If it does, what about emacs -Q?

– Gilles
Mar 9 '15 at 22:59













@Gilles Chinese characters also appear with -q and -Q as well.

– Marcus Junius Brutus
Mar 9 '15 at 23:17





@Gilles Chinese characters also appear with -q and -Q as well.

– Marcus Junius Brutus
Mar 9 '15 at 23:17










1 Answer
1






active

oldest

votes


















-1














The solution is to load the file with find-file-literally.






share|improve this answer










New contributor




ThuggieG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f189061%2femacs-automatically-adding-bom-to-xml-file%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    -1














    The solution is to load the file with find-file-literally.






    share|improve this answer










    New contributor




    ThuggieG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.

























      -1














      The solution is to load the file with find-file-literally.






      share|improve this answer










      New contributor




      ThuggieG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.























        -1












        -1








        -1







        The solution is to load the file with find-file-literally.






        share|improve this answer










        New contributor




        ThuggieG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.










        The solution is to load the file with find-file-literally.







        share|improve this answer










        New contributor




        ThuggieG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        share|improve this answer



        share|improve this answer








        edited 1 hour ago









        Jeff Schaller

        45.4k1165148




        45.4k1165148






        New contributor




        ThuggieG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        answered 2 hours ago









        ThuggieGThuggieG

        9




        9




        New contributor




        ThuggieG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.





        New contributor





        ThuggieG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






        ThuggieG is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f189061%2femacs-automatically-adding-bom-to-xml-file%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

            The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

            Ayherre Geografie Demografie Externe links Navigatiemenu43° 23′ NB, 1° 15′ WL43° 23′ NB, 1°...