• 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: Ken Thomases <email@hidden>
  • Date: Fri, 2 Oct 2009 23:46:10 -0500

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


  • Follow-Ups:
    • RE: Any way to get 16-bit string literals?
      • From: Stéphane Beauchemin <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>)

  • Prev by Date: Re: Any way to get 16-bit string literals?
  • Next by Date: Re: Doxygen generated DocSets and Quick Help
  • Previous by thread: Re: Any way to get 16-bit string literals?
  • Next by thread: RE: Any way to get 16-bit string literals?
  • Index(es):
    • Date
    • Thread