1# The weight of 0xA2A9 will be the same with its capital letter 0xA2F9 2select collation(cast(0xA2A9 as char)); 3select hex(weight_string(cast(0x6141 as char))); 4select hex(weight_string(cast(0xA2A9 as char))); 5select hex(weight_string(cast(0xA2A9 as char) as char(1))); 6select hex(weight_string(cast(0xA2A9A2A9 as char) as char(1))); 7select hex(weight_string(cast(0xA2A9 as char) as char(3))); 8select hex(weight_string(cast(0xA2A9A2A9 as char) as char(3))); 9select hex(weight_string(cast(0x40A2A9 as char) as char(3))); 10select hex(weight_string(cast(0x40A2A9A2A9 as char) as char(3))); 11select hex(weight_string(cast(0x40A2A9A2A9A2A9 as char) as char(3))); 12select hex(weight_string(cast(0x4040A2A9A2A9A2A9 as char) as char(3))); 13 14# Read 2 characters from the source string (the last character is not used) 15select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 1, 2, 0xC0)); 16select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 2, 2, 0xC0)); 17select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 3, 2, 0xC0)); 18select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 4, 2, 0xC0)); 19select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 5, 2, 0xC0)); 20select hex(weight_string(cast(0xA2A9A2A9A2A9 as char),25, 2, 0xC0)); 21 22# Read 3 characters from the source string (the entire string is used) 23select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 1, 3, 0xC0)); 24select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 2, 3, 0xC0)); 25select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 3, 3, 0xC0)); 26select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 4, 3, 0xC0)); 27select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 5, 3, 0xC0)); 28select hex(weight_string(cast(0xA2A9A2A9A2A9 as char),25, 3, 0xC0)); 29 30# Read 4 characters from the source string (extra space is added) 31select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 1, 4, 0xC0)); 32select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 2, 4, 0xC0)); 33select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 3, 4, 0xC0)); 34select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 4, 4, 0xC0)); 35select hex(weight_string(cast(0xA2A9A2A9A2A9 as char), 5, 4, 0xC0)); 36select hex(weight_string(cast(0xA2A9A2A9A2A9 as char),25, 4, 0xC0)); 37 38