content_image/700013.jpg
<img src='content_image/700013.jpg'>

•The <collation>  element permits a shift-after-method  attribute that affects character weight calculation for shift rules. The attribute has these permitted values: 

• simple : Calculate character weights as for reset rules that do not have a before  attribute. This is the default if the attribute is not given. 

• expand : Use expansions for shifts after reset rules. 

Suppose that ’0’  and ’1’  have weights of 0E29  and 0E2A  and we want to put all basic Latin letters between ’0’  and ’1’ : 

<reset>0</reset> <pc>abcdefghijklmnopqrstuvwxyz</pc> 

For simple shift mode, weights are calculated as follows: 

’a’ has weight 0E29+1 ’b’ has weight 0E29+2 ’c’ has weight 0E29+3 ... 

However, there are not enough vacant positions to put 26 characters between ’0’  and ’1’ . The result is that digits and letters are intermixed. 

To solve this, use shift-after-method="expand" . Then weights are calculated like this: 

’a’ has weight [0E29][233D+1] ’b’ has weight [0E29][233D+2] ’c’ has weight [0E29][233D+3] ... 

233D  is the UCA 4.0.0 weight for character 0xA48C , which is the last nonignorable character (a sort of the greatest character in the collation, excluding CJK). UCA 5.2.0 is similar but uses 3ACA , for character 0x1342E . 

## MySQL-Specific LDML Extensions 

An extension to LDML rules permits the <collation>  element to include an optional version  attribute in <collation>  tags to indicate the UCA version on which the collation is based. If the version  attribute is omitted, its default value is 4.0.0 . For example, this specification indicates a collation that is based on UCA 5.2.0: 

<collation id=" nnn " name="utf8_ xxx _ci" version="5.2.0"> ... 

