public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Support for Unicode in gcc
@ 2000-08-03  2:59 ssathyan
  2000-08-03  4:06 ` Alexandre Oliva
  0 siblings, 1 reply; 4+ messages in thread
From: ssathyan @ 2000-08-03  2:59 UTC (permalink / raw)
  To: egcs

Hi,

I am involved in porting applications from VC++ to Linux.
I am using gcc compiler. Is there support for Unicode in gcc.

How do I specify Unicode literal strings in the source code.
For example with microsoft compiler I specify Unicode strings as.

wchar_t   *wtext = L"abc";

How do we do this in gcc?

Thank's

Sajan

-------------------------------------------------------------------------------------------------

Sajan Sathyan
Sr Software Engineer
Smart Storage Pvt Ltd, C-8, Road No 22,  MIDC,
Andheri East,  Mumbai,  India, 400093.
Tel No Office          91-22-8259766 / 91-22-8259769 Ext 205
            Residence  91-22-8218682
-------------------------------------------------------------------------------------------------

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

* Re: Support for Unicode in gcc
  2000-08-03  2:59 Support for Unicode in gcc ssathyan
@ 2000-08-03  4:06 ` Alexandre Oliva
  2000-08-03  8:46   ` Michael Vance
  0 siblings, 1 reply; 4+ messages in thread
From: Alexandre Oliva @ 2000-08-03  4:06 UTC (permalink / raw)
  To: ssathyan; +Cc: gcc

On Aug  3, 2000, ssathyan@india.smartstorage.com wrote:

> wchar_t   *wtext = L"abc";

> How do we do this in gcc?

Just like in VC++.  The line above compiles successfully for me with
g++.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me


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

* Re: Support for Unicode in gcc
  2000-08-03  4:06 ` Alexandre Oliva
@ 2000-08-03  8:46   ` Michael Vance
  2000-08-03  9:52     ` Michael Meissner
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Vance @ 2000-08-03  8:46 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: ssathyan, gcc

On Thu, Aug 03, 2000 at 07:58:36AM -0300, Alexandre Oliva wrote:

> > wchar_t   *wtext = L"abc";
> 
> > How do we do this in gcc?
> 
> Just like in VC++.  The line above compiles successfully for me with
> g++.

Right. Except that VC++ generates a string with two-byte characters,
and gcc generates a string with four-byte characters.

m.

-- 
Programmer             "Ha ha." "Ha ha." "What are you laughing at?"
Loki Software                      "Just the horror of being alive."
http://lokigames.com/~briareos/                   - Tony Millionaire

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

* Re: Support for Unicode in gcc
  2000-08-03  8:46   ` Michael Vance
@ 2000-08-03  9:52     ` Michael Meissner
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Meissner @ 2000-08-03  9:52 UTC (permalink / raw)
  To: Michael Vance; +Cc: Alexandre Oliva, ssathyan, gcc

On Thu, Aug 03, 2000 at 08:46:34AM -0700, Michael Vance wrote:
> On Thu, Aug 03, 2000 at 07:58:36AM -0300, Alexandre Oliva wrote:
> 
> > > wchar_t   *wtext = L"abc";

In standards speak, you are not getting a Unicode string with the above, you
are getting a wide character string.  It just so happens on the Windows system,
that they use currently use Unicode for the wide character representation.

> > > How do we do this in gcc?
> > 
> > Just like in VC++.  The line above compiles successfully for me with
> > g++.
> 
> Right. Except that VC++ generates a string with two-byte characters,
> and gcc generates a string with four-byte characters.

You didn't mention what system you are using.  Different systems have different
sizes of wchar_t.  GCC tries to conform to whatever is the local convention on
the system.

-- 
Michael Meissner, Red Hat, Inc.
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work:	  meissner@redhat.com		phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org	fax:   +1 978-692-4482

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

end of thread, other threads:[~2000-08-03  9:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-03  2:59 Support for Unicode in gcc ssathyan
2000-08-03  4:06 ` Alexandre Oliva
2000-08-03  8:46   ` Michael Vance
2000-08-03  9:52     ` Michael Meissner

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).