Add comments suggested by David

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20964 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2005-03-22 10:40:37 +00:00
parent b72acfde4a
commit 49026359da

View file

@ -3378,6 +3378,17 @@ static NSCharacterSet *tokenSet = nil;
charsets = NSCreateMapTable (NSObjectMapKeyCallBacks,
NSIntMapValueCallBacks, 0);
/*
* These mappings were obtained from
* http://www.iana.org/assignments/character-sets
*
* We should ideally have all the aliases for each
* encoding we support, but I just did the aliases
* for ascii and latin1 as these (and utf-8 which
* has no aliases) account for most mime documents.
* Feel free to add more.
*/
// All the ascii mappings from IANA
NSMapInsert(charsets, (void*)@"ansi_x3.4-1968",
(void*)NSASCIIStringEncoding);
@ -3473,6 +3484,16 @@ static NSCharacterSet *tokenSet = nil;
{
encodings = NSCreateMapTable (NSIntMapKeyCallBacks,
NSObjectMapValueCallBacks, 0);
/* While the charset mappings above are many to one,
* mapping a variety of names to one encoding,
* the encodings map is a one to one mapping.
*
* The charset names used here should be the PREFERRED
* charset names from the IANA registration if one is
* specified.
* We adopt the convention that all names are in lowercase.
*/
NSMapInsert(encodings, (void*)NSASCIIStringEncoding,
(void*)@"us-ascii");
NSMapInsert(encodings, (void*)NSISOLatin1StringEncoding,