[Mono-list] Embedded API: identifier encoding.

jonathan at mugginsoft.com jonathan at mugginsoft.com
Mon Mar 3 16:46:37 UTC 2014


In my ObjC - Mono bridge I do something like:

MonoObject *monoObject = [self getMonoProperty:"FloatNullable”];

The question is what is the precise encoding required of the property identifier?

A C# identifier is defined here : http://msdn.microsoft.com/en-us/library/aa664670.aspx
The rules for identifiers given in this section correspond exactly to those recommended by the Unicode Standard Annex 15. http://unicode.org/reports/tr15/

The char * identifier is derived from XML that is sourced from reflecting on a .NET binary assembly 
This assembly may, in theory at least, have been written in any supported CLR language.

Hence the Common Language Specification could then apply: http://msdn.microsoft.com/en-us/library/12a7a7h3(v=vs.110).aspx

This is governed by the CLS specification, chapter 8.5.1 "Valid names":

CLS Rule 4: Assemblies shall follow Annex 7 of Technical Report 15 of the Unicode Standard 3.0 governing the set of characters permitted to start and be included in identifiers, available on-line athttp://www.unicode.org/unicode/reports/tr15/tr15-18.html. Identifiers shall be in the canonical format defined by Unicode Normalization Form C. For CLS purposes, two identifiers are the same if their lowercase mappings (as specified by the Unicode locale-insensitive, one-to-one lowercase mappings) are the same. That is, for two identifiers to be considered different under the CLS they shall differ in more than simply their case. However, in order to override an inherited definition the CLI requires the precise encoding of the original declaration be used.

Will Mono execute a binary dll compiled from anything other than C# source?

Jonathan













More information about the Mono-list mailing list