9 Replies Latest reply on May 6, 2010 2:27 AM by 羊怪

    We need utf-8 BOM in *.cf* Files

    neti_netwalker Level 1

      In the Coldfusion8 Doc you can read:

      Adobe recommends that you use BOM characters in your files.

      (http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=i18n_10.html)

       

      How can we change the encoding from utf-8 without BOM to utf-8 with BOM? I think it is an internal eclipse problem.

       

      Does anyone know a goog solution for this problem?

        • 1. Re: We need utf-8 BOM in *.cf* Files
          neti_netwalker Level 1

          I try the new Beta2 and we have the same problem!

           

          Does anyone know a good solution for this problem?

          • 2. Re: We need utf-8 BOM in *.cf* Files
            Adam Cameron. Level 5

            The docs are talking nonsense: there's not need to specify a BOM.  Just set your default encoding to UTF-8.

             

            If your CF templates have any non-ASCII characters in them, then tell the compiler to expect UTF-8 data using the <cfprocessingdirective> tag.

             

            --

            Adam

            1 person found this helpful
            • 3. Re: We need utf-8 BOM in *.cf* Files
              neti_netwalker Level 1

              Hello Adam

               

              I think this is not a good solution. All of our current files uses UTF-8 BOM we don't want do change every file.

               

              How can we change the default compiler behavor to recognize all files as UTF-8?

               

              How can we change the default processingdirective?

               

               

              Every good texteditor can add BOM to UTF-8 Files.

              • 5. Re: We need utf-8 BOM in *.cf* Files
                Adam Cameron. Level 5

                I don't see what your problem is here.

                 

                If you tell CFB to create new files as UTF-8, it will.  It does not put a BOM in the file, but the BOM is not necessary for the file to be recognised as UTF-8.  Equally, there is no problem if your files do have a BOM.

                 

                What actual problem are you having here?  Actual problem, not theoretical problem.  Why do you need there to be a BOM in the file?

                 

                --

                Adam

                • 6. Re: We need utf-8 BOM in *.cf* Files
                  Adam Cameron. Level 5

                  Also, have you raised an enhancement request for this (but you better provide a thorough rationale for it!):http://cfbugs.adobe.com/bugreport/flexbugui/cfbugtracker/main.html

                   

                  --

                  Adam

                  • 7. Re: We need utf-8 BOM in *.cf* Files
                    羊怪 Level 1

                    I have the same problem !!!

                    In my case, we need to output chinese/japanese pages.

                    The CFB (ColdFusion Builder) do not write BOM to .cfm files, so it will display random code when we save>close>reopen it.

                    and also, CF server 8 do not display correct characters in web page.

                    But, if we reopen it and save it to UTF8 by notepad. (or by Dreamweaver with BOM checked)

                    it will display chinese/japanese normally.....

                     

                    we don't want to re-save all files by notepad or other applications.

                    and for edit these files by CFB, I think the BOM function is necessary.

                     

                    Adan wrote:

                    If you tell CFB to create new files as UTF-8, it will.  It does not put a BOM in the file, but the BOM is not necessary for the file to be recognised as UTF-8.  Equally, there is no problem if your files do have a BOM.

                     

                    actually, the problem CFB create files as UTF-8 without BOM is we have no idea to edit a cfml include other language like chinese or japanese !!

                    how can we slove this problem?

                     

                     

                    (I know the BOM is not necessary for UTF-8. but if I want to edit a cfm with chinese characters inside, it seems to be necessary.)

                    (Sorry if I misspelled something, my native language is chinese.)

                    • 8. Re: We need utf-8 BOM in *.cf* Files
                      tooMuchTrouble Level 3

                      the unicode spec says the BOM is optional for UTF-8 (which if you think about

                      it's not needed, there's only the 1 byte order for UTF-8). eclipse, which cf

                      builder (CFB), cfeclipse (CFE), et al is based on, doesn't write out a BOM.

                       

                      i use thai, japanese, arabic, etc. in cf files edited w/CFB, CFE & even with

                      notepad (don't ask). all work fine.

                       

                      are you sure your files are utf-8 encoded in the 1st place? can you zip up &

                      attach a simple example of one that's causing you problems?

                      • 9. Re: We need utf-8 BOM in *.cf* Files
                        羊怪 Level 1

                        Thanks Paul,

                         

                        it so strange...

                        since you made a response to me, I tried to install CFB on my home pc.

                        and it's just incredible work fine..    =  ="

                        I think the problem is on my work pc...........

                        I will try it tomorrow,

                        and thanks for your enthusiastic help.