Re: File encoding for files ported between Mac and Windows?
Re: File encoding for files ported between Mac and Windows?
- Subject: Re: File encoding for files ported between Mac and Windows?
- From: Ricky Sharp <email@hidden>
- Date: Tue, 5 Jan 2010 20:15:40 -0600
On Jan 5, 2010, at 7:21 PM, David Dunham wrote:
> On 5 Jan 2010, at 10:47, Howard Moon wrote:
>
>> I write a lot of C++ code that is shared between Mac and Windows. I just went through all my files (using CodeWarrior) to make sure that they're all set to use Windows line endings (CR/LF), so that they will load properly in Visual Studio on the PC. However, I'm wondering if I need to do anything about the "file encoding" setting I see on the Mac when I do a Get Info on a file. The files I have mostly say "Western (Mac OS Roman)", but the Preferences setting is "Unicode (UTF-8)". I'm wondering if this makes any difference at all, and if I need to go through and change each file individually to one or the other encoding.
>
>
> I set them to UTF-8 but pretty much on an as-you-go basis. It seldom matters (because code is in ASCII, and strings are external, right?).
While one's code should be ASCII7-only (also a proponent of externalized strings), be careful when using UTF-8. Some tools may add the optional 3-byte BOM at the beginning. And, not all tools are savvy. If you see a few bytes of what appears to be garbage at the beginning, that's typically a tool not dealing with the BOM correctly.
If your code is truly ASCII7, it would probably be best to use the original encodings on each platform. That would be MacRoman under Mac OS X and windows-1252 (on US-English Windows).
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
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