Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
UCD load script
Last updated at 9:17 am UTC on 21 January 2019
UCD

The following secript is derived from Unicode class parseCompositionMappingFrom:.

 | unicodeData |
 unicodeData := (HTTPClient httpGetDocument: 'http://www.unicode.org/Public/UNIDATA/UnicodeData.txt') contents.
UCDnames := Dictionary new.
UCDgeneralCategory := Dictionary new.
toNumber := [:quad | quad inject: 0 into:[:sum :ch| sum * 16 + ch digitValue]].
unicodeData linesDo: [ :line |
		| fields |
		(fields := line splitBy: ';') size > 13 ifTrue: [
			| codePoint  |

			codePoint := (fields at: 1).
			UCDnames at: codePoint put: (fields at: 2).
			UCDgeneralCategory at: codePoint put: (fields at: 3).
			]].
 UCDnames inspect.
 UCDgeneralCategory inspect