public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: 2 byte wide character support
@ 2004-11-05 22:20 lrtaylor
  0 siblings, 0 replies; 3+ messages in thread
From: lrtaylor @ 2004-11-05 22:20 UTC (permalink / raw)
  To: kwinter1, gcc-help

Klaus,

Probably not what you want to hear, but if you're depending on the size of characters in your pointer arithmetic, then my inclination is to think that you're not doing things properly.  Pointer arithmetic normally automatically takes the size of the type into account for you.  Explicitly depending on the size of types like that is also a very unportable way to program.  You might just consider replacing all of your 2's with "sizeof(wchar_t)".  Then it shouldn't matter what size a character is.  Of course, I don't know exactly what it is you're trying to do, so this is just a shot in the dark...

Thanks,
Lyle


-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of Klaus Winter
Sent: Friday, November 05, 2004 2:30 PM
To: gcc-help@gcc.gnu.org
Subject: 2 byte wide character support

Hi,

I'm currently porting a Windows application to Linux. After some easy issues
the code compiled fine wiht gcc 3.3.1 But mysteriously the code didn't do
what I expected it to do. After some time I found that widecharacters
(wchar_t) are 4 bytes in all GNU systems instead of the expected 2 bytes.
With setting the flag -fshort-wchar this problem was solved but another one
arose. Now most glibc functions handling widecharacters don't work properly
anymore. (currently I'm converting them back and forth to the value needed )
I'm looking for a better of handling this: perhaps enabling  functions like
wcscmp(...) to handle 2byte widecharacters. ( 2byte widecharacters are
NEEDED because of pointer arithmetic in the application ). Any help is
appreciated.

Klaus

-- 
NEU +++ DSL Komplett von GMX +++ http://www.gmx.net/de/go/dsl
GMX DSL-Netzanschluss + Tarif zum supergünstigen Komplett-Preis!

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

* Re: 2 byte wide character support
  2004-11-05 21:30 Klaus Winter
@ 2004-11-05 21:57 ` Ken Foskey
  0 siblings, 0 replies; 3+ messages in thread
From: Ken Foskey @ 2004-11-05 21:57 UTC (permalink / raw)
  To: gcc help

On Fri, 2004-11-05 at 22:30 +0100, Klaus Winter wrote:
> anymore. (currently I'm converting them back and forth to the value needed )
> I'm looking for a better of handling this: perhaps enabling  functions like
> wcscmp(...) to handle 2byte widecharacters. ( 2byte widecharacters are
> NEEDED because of pointer arithmetic in the application ). Any help is
> appreciated.

Klaus,

Probably not the answer you are looking for but you might want to look
at icu from IBM.  It is an open source tool to work with Unicode.

-- 
Ken Foskey

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

* 2 byte wide character support
@ 2004-11-05 21:30 Klaus Winter
  2004-11-05 21:57 ` Ken Foskey
  0 siblings, 1 reply; 3+ messages in thread
From: Klaus Winter @ 2004-11-05 21:30 UTC (permalink / raw)
  To: gcc-help

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 900 bytes --]

Hi,

I'm currently porting a Windows application to Linux. After some easy issues
the code compiled fine wiht gcc 3.3.1 But mysteriously the code didn't do
what I expected it to do. After some time I found that widecharacters
(wchar_t) are 4 bytes in all GNU systems instead of the expected 2 bytes.
With setting the flag -fshort-wchar this problem was solved but another one
arose. Now most glibc functions handling widecharacters don't work properly
anymore. (currently I'm converting them back and forth to the value needed )
I'm looking for a better of handling this: perhaps enabling  functions like
wcscmp(...) to handle 2byte widecharacters. ( 2byte widecharacters are
NEEDED because of pointer arithmetic in the application ). Any help is
appreciated.

Klaus

-- 
NEU +++ DSL Komplett von GMX +++ http://www.gmx.net/de/go/dsl
GMX DSL-Netzanschluss + Tarif zum supergünstigen Komplett-Preis!

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

end of thread, other threads:[~2004-11-05 22:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-05 22:20 2 byte wide character support lrtaylor
  -- strict thread matches above, loose matches on Subject: below --
2004-11-05 21:30 Klaus Winter
2004-11-05 21:57 ` Ken Foskey

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