• 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: wstring
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wstring


  • Subject: Re: wstring
  • From: Chris Ridd <email@hidden>
  • Date: Fri, 19 Mar 2004 06:21:08 +0000

On 18/3/04 4:17 pm, Bernard Meers <email@hidden> wrote:

> We are using X-Platform code that uses std::wstring heavily.
> As I understand these are 32 bit under the GCC.
> We have to display those strings and therefore we need to convert them.
> How can we translate from 32 bit unicode into 16 bit unicode?
> Are there other options?
>
> All help appreciated.
> Bernard

Wstrings are strings of wchar_t, which are 4 bytes wide on 10.3. I can't
however see any definition of what each wchar_t actually contains, but
they're probably UTF-32. Note that the contents of wchar_t is *very*
implementation dependent. (Which might explain the documentation's
reticence.)

Apple has various converters in CoreFoundation and Foundation, but none of
them (AFAICS) can cope with UTF-32. However doing so yourself is a simple
matter of programming, and you should probably look at
<URL:http://www.unicode.org/faq/utf_bom.html>. They've even got links to
sample code.

Cheers,

Chris
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: wstring
      • From: Chris Espinosa <email@hidden>
References: 
 >wstring (From: Bernard Meers <email@hidden>)

  • Prev by Date: Re: build.xml
  • Next by Date: Re: debugging jnilib from XCode
  • Previous by thread: wstring
  • Next by thread: Re: wstring
  • Index(es):
    • Date
    • Thread