• 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: How to detect endian-ness in Swift?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to detect endian-ness in Swift?


  • Subject: Re: How to detect endian-ness in Swift?
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Wed, 23 Jul 2014 20:13:56 +0700

On 23 Jul 2014, at 20:09, Jean-Daniel Dupas <email@hidden> wrote:

> Doesn't swift support only little endian platform anyway ?

Probably. All current Mac hardware seems to be little-endian (not sure about iOS).
But in the past (and maybe the future?) this was not the case.
Objective-C understands __LITTLE_ENDIAN__; so why not Swift?

>
> Le 23 juil. 2014 à 11:59, Gerriet M. Denkmann <email@hidden> a écrit :
>
>> This compiles without warnings:
>>
>> #if __LITTLE_ENDIAN__
>> 	let encoding = NSUTF32LittleEndianStringEncoding;
>> 	println("LittleEndian")
>> #else
>> 	let encoding = NSUTF32BigEndianStringEncoding;
>> 	println("BigEndian")
>> #endif
>>
>> But it prints "BigEndian", which probably is NOT quite right.
>> How to correctly set my encoding?


 _______________________________________________
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: How to detect endian-ness in Swift?
      • From: Jean-Daniel Dupas <email@hidden>
References: 
 >How to detect endian-ness in Swift? (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: How to detect endian-ness in Swift? (From: Jean-Daniel Dupas <email@hidden>)

  • Prev by Date: Re: How to detect endian-ness in Swift?
  • Next by Date: Re: How to detect endian-ness in Swift?
  • Previous by thread: Re: How to detect endian-ness in Swift?
  • Next by thread: Re: How to detect endian-ness in Swift?
  • Index(es):
    • Date
    • Thread