• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: Any way to get 16-bit string literals?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Any way to get 16-bit string literals?


  • Subject: RE: Any way to get 16-bit string literals?
  • From: Stéphane Beauchemin <email@hidden>
  • Date: Mon, 5 Oct 2009 12:58:58 -0400
  • Thread-topic: Any way to get 16-bit string literals?

Oups, I have confused it with another option, but what you are looking for is probably:

-fshort-wchar
           Override the underlying type for wchar_t to be short unsigned int instead of the default for the target.  This option is useful for building programs to run under WINE.

           Warning: the -fshort-wchar switch causes GCC to generate code that is not binary compatible with code generated without that switch.  Use it to conform to a non-default application binary interface.


-----Original Message-----
From: xcode-users-bounces+sbeauchemin=email@hidden [mailto:xcode-users-bounces+sbeauchemin=email@hidden] On Behalf Of Stéphane Beauchemin
Sent: October-05-09 11:32 AM
To: Ken Thomases; Jens Alfke
Cc: XCode Users
Subject: RE: Any way to get 16-bit string literals?

Have you tried to use gcc or g++ option: -fwide-exec-charset=charset ?

Stephane

-----Original Message-----
From: xcode-users-bounces+sbeauchemin=email@hidden [mailto:xcode-users-bounces+sbeauchemin=email@hidden] On Behalf Of Ken Thomases
Sent: October-03-09 12:46 AM
To: Jens Alfke
Cc: XCode Users
Subject: Re: Any way to get 16-bit string literals?

On Oct 2, 2009, at 11:27 PM, Jens Alfke wrote:

> On Oct 2, 2009, at 5:12 PM, Jean-Denis Muys wrote:
>
>> Also copying a char[] array to a uint16_t[] array is likely not to
>> do what you expect.
>
> Oh, don't worry, I know all about character encoding conversion :)
> You're correct in general, but the string literals used in WebCore
> are all plain ascii. (They're mostly things like HTML and SVG tag
> names, and HTTP headers.)

What's done in the Wine sources isn't pretty, but it's straightforward
and gets the job done:

const uint16_t myString[] = {'H','e','l','l','o',',','
','W','o','r','l','d','!','\n',0};

After all, that is all that a string literal is, under the covers.  :)

Cheers,
Ken

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >re: Any way to get 16-bit string literals? (From: Jean-Denis Muys <email@hidden>)
 >Re: Any way to get 16-bit string literals? (From: Jens Alfke <email@hidden>)
 >Re: Any way to get 16-bit string literals? (From: Ken Thomases <email@hidden>)
 >RE: Any way to get 16-bit string literals? (From: Stéphane Beauchemin <email@hidden>)

  • Prev by Date: Re: Any way to get 16-bit string literals?
  • Next by Date: Re: Any way to get 16-bit string literals?
  • Previous by thread: Re: Any way to get 16-bit string literals?
  • Next by thread: Xcode 3.2 cannot launch app anymore
  • Index(es):
    • Date
    • Thread