Re: [Afpfs-ng-devel] precompose and decompose
Status: Alpha
Brought to you by:
alexthepuffin
From: Alex d. <ale...@gm...> - 2008-03-27 19:02:13
|
HAT, Unfortunately, my understanding of multibyte character support is limited, so I really appreciate your attention to this. Would you consider creating a patch to support any of this? It would be a very valuable addition. - Alex On 27-Mar-08, at 2:52 PM, HAT wrote: > hi. > > I'm reading the source of afpfs-ng 0.8.1 for the first time now. > I think that there are problems in precomposing and decomposing. > > 1) precompose two characters only: supported > 2) precompose two characters over: unsupported > 3) decompose: sample only > 4) hangul: unsupported > 5) Unicode U+010000 over: unsupported > 6) maccodepage for AFP2: unsupported > > The 2), 3) and 4) can be implemented comparatively easily > because I did them for netatalk. > > There are two methods to support the U+010000 over. > > a) Using surrogate pair > b) Using UCS4 instead of UCS2 > > The surrogate pair is dirty and complex. > Because netatalk 2.1dev use the surrogate pair, It is difficult > to support the U+010000 over. > If we use UCS4 instead of UCS2, the implementation will be easy. > > Replace. > > from > char16 *UTF8toUCS2(str) > to > u_int32_t *UTF8toUCS4(str) > > from > int UCS2precompose(first, second) > to > u_int64_t UCS4precompose(first, second) > > from > // worst case: 3 bytes of UTF8 per UCS2 char + terminal 0 > to > // worst case: 4 bytes of UTF8 per UCS4 char + terminal 0 > > > The size of table[] is two times. > > static struct { > int precomposed; > unsigned int pattern; > } table[] = { > { 0x00000000, 0x0000000000000000}, // Dummy entry table[0] > { 0x000000C0, 0x0000004100000300}, > { 0x000000C1, 0x0000004100000301}, > { 0x000000C2, 0x0000004100000302}, > (snip) > { 0x0001D1BF, 0x0001D1BB0001D16F}, > { 0x0001D1BE, 0x0001D1BC0001D16E}, > { 0x0001D1C0, 0x0001D1BC0001D16F}, > }; > > > PS. > Don't trust the Apple's documents. > > http://developer.apple.com/technotes/tn/tn1150table.html > This table is based on Unicode 2.x. > > http://developer.apple.com/documentation/Networking/Conceptual/AFP/AFP3_1.pdf > This document is based on Unicode 3.2. > > Mac OS X 10.5.2 Leopard use newer Unicode. > 0x1B06 to 0x1B05 0x1B35 > This is not in Unicode 3.2. > > -- > HAT <ha...@fa...> > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Afpfs-ng-devel mailing list > Afp...@li... > https://lists.sourceforge.net/lists/listinfo/afpfs-ng-devel |