public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/33415] Can't compile .cpp file with UTF-8 BOM.
       [not found] <bug-33415-4@http.gcc.gnu.org/bugzilla/>
@ 2013-03-25  5:03 ` chalakella at yahoo dot com
  2013-03-25 13:50 ` bangerth at gmail dot com
  2013-03-25 14:15 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 10+ messages in thread
From: chalakella at yahoo dot com @ 2013-03-25  5:03 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33415

Vikas <chalakella at yahoo dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |chalakella at yahoo dot com

--- Comment #8 from Vikas <chalakella at yahoo dot com> 2013-03-25 05:02:57 UTC ---
Hi Experts

I am facing the same kind of problem......

I had an c++ application which uses unicode string inside it, I had compiled
the solution using Visual Studio 2012. The file is saved in utf-8 with BOM(byte
order marker). When I run the same file in linux, I got the following errors:-
 error: stray '\239' in program
 1: error: stray '\187' in program
 1: error: stray '\191' in program

I found that gcc won't support BOM in the c++ file.If I remove the BOM from the
file error get resolved. Is there a way by which I can compile my application
containing files saved in utf-8 with BOM ?

I am compiling the application in "Red hat enterprise Linux 4 edition" , where
GCC version 3.4.6. 

Please help me in this regard.


Thanks & Regards
 Vikas


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug preprocessor/33415] Can't compile .cpp file with UTF-8 BOM.
       [not found] <bug-33415-4@http.gcc.gnu.org/bugzilla/>
  2013-03-25  5:03 ` [Bug preprocessor/33415] Can't compile .cpp file with UTF-8 BOM chalakella at yahoo dot com
@ 2013-03-25 13:50 ` bangerth at gmail dot com
  2013-03-25 14:15 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 10+ messages in thread
From: bangerth at gmail dot com @ 2013-03-25 13:50 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33415

--- Comment #9 from Wolfgang Bangerth <bangerth at gmail dot com> 2013-03-25 13:50:00 UTC ---
Vikas: This was fixed in GCC in 2008. The version of GCC you are using (3.4.6)
was released in 2006 and the entire 3.4.x tree is in fact from 2004. It is time
for you to upgrade your system after almost a decade if there are features you
need.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug preprocessor/33415] Can't compile .cpp file with UTF-8 BOM.
       [not found] <bug-33415-4@http.gcc.gnu.org/bugzilla/>
  2013-03-25  5:03 ` [Bug preprocessor/33415] Can't compile .cpp file with UTF-8 BOM chalakella at yahoo dot com
  2013-03-25 13:50 ` bangerth at gmail dot com
@ 2013-03-25 14:15 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu.org @ 2013-03-25 14:15 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33415

--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-03-25 14:15:17 UTC ---
And please don't use Bugzilla for questions about using GCC, use the gcc-help
mailing list, thanks.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug preprocessor/33415] Can't compile .cpp file with UTF-8 BOM.
  2007-09-13 10:04 [Bug c++/33415] New: " huzheng_001 at 163 dot com
                   ` (5 preceding siblings ...)
  2008-04-21 14:03 ` tromey at gcc dot gnu dot org
@ 2009-06-14 23:03 ` jsm28 at gcc dot gnu dot org
  6 siblings, 0 replies; 10+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-06-14 23:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jsm28 at gcc dot gnu dot org  2009-06-14 23:03 -------
*** Bug 40441 has been marked as a duplicate of this bug. ***


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dh dot liu at msa dot hinet
                   |                            |dot net


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33415


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug preprocessor/33415] Can't compile .cpp file with UTF-8 BOM.
  2007-09-13 10:04 [Bug c++/33415] New: " huzheng_001 at 163 dot com
                   ` (4 preceding siblings ...)
  2008-04-21 14:03 ` tromey at gcc dot gnu dot org
@ 2008-04-21 14:03 ` tromey at gcc dot gnu dot org
  2009-06-14 23:03 ` jsm28 at gcc dot gnu dot org
  6 siblings, 0 replies; 10+ messages in thread
From: tromey at gcc dot gnu dot org @ 2008-04-21 14:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from tromey at gcc dot gnu dot org  2008-04-21 14:02 -------
Subject: Bug 33415

Author: tromey
Date: Mon Apr 21 14:02:00 2008
New Revision: 134507

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=134507
Log:
libcpp
        PR libcpp/33415:
        * charset.c (_cpp_convert_input): Add buffer_start argument.
        Ignore UTF-8 BOM if seen.
        * internal.h (_cpp_convert_input): Add argument.
        * files.c (struct _cpp_file) <buffer_start>: New field.
        (destroy_cpp_file): Free buffer_start, not buffer.
        (_cpp_pop_file_buffer): Likewise.
        (read_file_guts): Update.
gcc/testsuite
        PR libcpp/33415:
        * gcc.dg/cpp/pr33415.c: New file.

Added:
    trunk/gcc/testsuite/gcc.dg/cpp/pr33415.c
Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/libcpp/ChangeLog
    trunk/libcpp/charset.c
    trunk/libcpp/files.c
    trunk/libcpp/internal.h


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33415


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug preprocessor/33415] Can't compile .cpp file with UTF-8 BOM.
  2007-09-13 10:04 [Bug c++/33415] New: " huzheng_001 at 163 dot com
                   ` (3 preceding siblings ...)
  2008-04-16 21:30 ` tromey at gcc dot gnu dot org
@ 2008-04-21 14:03 ` tromey at gcc dot gnu dot org
  2008-04-21 14:03 ` tromey at gcc dot gnu dot org
  2009-06-14 23:03 ` jsm28 at gcc dot gnu dot org
  6 siblings, 0 replies; 10+ messages in thread
From: tromey at gcc dot gnu dot org @ 2008-04-21 14:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from tromey at gcc dot gnu dot org  2008-04-21 14:02 -------
Fixed on trunk.
As I doubt this will be back-ported to 4.3.x, I am closing the bug.


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.4.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33415


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug preprocessor/33415] Can't compile .cpp file with UTF-8 BOM.
  2007-09-13 10:04 [Bug c++/33415] New: " huzheng_001 at 163 dot com
                   ` (2 preceding siblings ...)
  2008-04-16 20:38 ` tromey at gcc dot gnu dot org
@ 2008-04-16 21:30 ` tromey at gcc dot gnu dot org
  2008-04-21 14:03 ` tromey at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: tromey at gcc dot gnu dot org @ 2008-04-16 21:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from tromey at gcc dot gnu dot org  2008-04-16 21:29 -------
Testing a patch.


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |tromey at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-09-14 09:28:32         |2008-04-16 21:29:21
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33415


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug preprocessor/33415] Can't compile .cpp file with UTF-8 BOM.
  2007-09-13 10:04 [Bug c++/33415] New: " huzheng_001 at 163 dot com
  2007-09-14  4:12 ` [Bug preprocessor/33415] " bangerth at dealii dot org
  2007-09-14  9:28 ` pinskia at gcc dot gnu dot org
@ 2008-04-16 20:38 ` tromey at gcc dot gnu dot org
  2008-04-16 21:30 ` tromey at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: tromey at gcc dot gnu dot org @ 2008-04-16 20:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from tromey at gcc dot gnu dot org  2008-04-16 20:37 -------
I think some BOMs will be handled by iconv.
In particular I tried UTF-16 and this seemed to work ok.

UTF-8 is a special problem in two ways.  First, glibc's iconv does not
appear to recognize the UTF-8 BOM.

And, even if it did, we special-case UTF-8 (at least on non-EBCDIC hosts).

This could be fixed in files.c without too much difficulty (it makes a few
inconvenient assumptions), except that files.c does not know the name of the
source charset.


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33415


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug preprocessor/33415] Can't compile .cpp file with UTF-8 BOM.
  2007-09-13 10:04 [Bug c++/33415] New: " huzheng_001 at 163 dot com
  2007-09-14  4:12 ` [Bug preprocessor/33415] " bangerth at dealii dot org
@ 2007-09-14  9:28 ` pinskia at gcc dot gnu dot org
  2008-04-16 20:38 ` tromey at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-09-14  9:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2007-09-14 09:28 -------
Actually I already know this is not handled.  In fact any of the BOMs are not
handled.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-09-14 09:28:32
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33415


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug preprocessor/33415] Can't compile .cpp file with UTF-8 BOM.
  2007-09-13 10:04 [Bug c++/33415] New: " huzheng_001 at 163 dot com
@ 2007-09-14  4:12 ` bangerth at dealii dot org
  2007-09-14  9:28 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: bangerth at dealii dot org @ 2007-09-14  4:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from bangerth at dealii dot org  2007-09-14 04:12 -------
Please attach a testcase. See
  http://gcc.gnu.org/bugs.html
for more information.
W.


-- 

bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bangerth at dealii dot org
             Status|UNCONFIRMED                 |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33415


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-03-25 14:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-33415-4@http.gcc.gnu.org/bugzilla/>
2013-03-25  5:03 ` [Bug preprocessor/33415] Can't compile .cpp file with UTF-8 BOM chalakella at yahoo dot com
2013-03-25 13:50 ` bangerth at gmail dot com
2013-03-25 14:15 ` redi at gcc dot gnu.org
2007-09-13 10:04 [Bug c++/33415] New: " huzheng_001 at 163 dot com
2007-09-14  4:12 ` [Bug preprocessor/33415] " bangerth at dealii dot org
2007-09-14  9:28 ` pinskia at gcc dot gnu dot org
2008-04-16 20:38 ` tromey at gcc dot gnu dot org
2008-04-16 21:30 ` tromey at gcc dot gnu dot org
2008-04-21 14:03 ` tromey at gcc dot gnu dot org
2008-04-21 14:03 ` tromey at gcc dot gnu dot org
2009-06-14 23:03 ` jsm28 at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).