Re: New Project Assistant macro expansion
Re: New Project Assistant macro expansion
- Subject: Re: New Project Assistant macro expansion
- From: Peter Teeson <email@hidden>
- Date: Mon, 12 Sep 2005 20:22:36 -0400
On 2005-Sep-05, at 9:11 AM, Peter Teeson wrote:
On 10-Sep-05, at 8:27 AM, David P Henderson wrote:
On 09/09/2005, at 21:50, Peter Teeson wrote:
You may be right but I don't think so.
Take a look at the class.m file preview as shown in the Finder.
Here is the full path:
Volumes/Tiger/Library/Application support/Apple/Developer Tools/
File Templates/Cocoa/Objective-C NSDocument
subclass.pbfiletemplate/class.m
Finder shows it exactly as I typed it. You can open them in the
text editor of your choice - BBEdit in my case.
What is the default file encoding you set for BBEdit. Mine is set
to UTF8 and while Finder's preview shows ¬' & ¬ª, opening the file
template in BBedit reveals that the characters in UTF8 are the « &
» characters. What you are seeing is an artifact of the Finder
using Mac OS Roman as the default text encoding. I know for a fact
that the « & » are the correct macro delimiters. The different
display representations have to do with the fact that the
underlying os deals with all text as utf8 while gui apps are split
between pre-Mac OS X default text encoding, Mac OS Roman, and utf8.
Notice that I am referring to File Templates not Project Templates.
I was fully aware, but it is irrelevant. The macros work the same
without regard to whether the template is a "File Template" or a
"Project Template"; the mechanism is the same
Of course in the Project Templates the macros are shown with
<<...>> as the delimiters. I know that.
In the Project Templates the files have already been partially
processed and the option-ell option-9 replaced with << & >>
Again the difference which you are seeing has to do with the files
text encoding setting. My bet is that the files in /Library/
Application support/Apple/Developer Tools/File Templates/ have a
default encoding of utf8 while the files in /Library/Application
support/Apple/Developer Tools/Project Templates/ are still using
Mac OS Roman as the default encoding.
I do know that the Macro expansion mechanism in the original
Project Builder (Xcode's predecessor) required that the file's
text encoding be set to Mac OS Roman. Xcode, however, seems to
work with Mac OS Roman or UTF8 so long as the correct characters
(« & ») are used.
You are 100% correct and I tip my hat to you in respect. Especially
for your patience in explaining. Thank you.
My setting for BBEdit was auto-detect. Hex dumping the file shows
the UTF-8 structure.
Who would have thought! I wonder what possible benefit there is for
those files.
Not to beat a dead horse but I thought you might be interested in
this which I think supports my original hypothesis.
BBEdit's Hex Dump Front Document appears to dump everything in UTF
style (see their manual page 40)
But Hex Dump File shows C2AB and C2BB (Option-ell, Option-shift-E,
and Option-ell, Option-9) and as single byte chars not UTF-8
The HexEdit app shows the same thing.
From this I infer that « » are indeed special delimiters used
within XCode and are related to detecting and pre-processing the
template macros.
Now wouldn't it be really nice to have the capability to override
them the way we can with ORGANIZATIONNAME?
How can I file an enhancement request - through bug-reporter?
respect....
Peter
_______________________________________________
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