z/OS Unicode Services User's Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Work buffer length considerations

z/OS Unicode Services User's Guide and Reference
SA38-0680-00

The work buffer length has the same considerations for both 31-bit and 64-bit. There are two main considerations, both of them are related to the collation level you specify. Following are the two possibilities:
  • Case 1 - CUNBOPRM_Coll_Level = 1, 2 or 3. For this case, you must consider at least twice the value of the source length (CUNBOPRM_SrcX_Buf_Len * 2), where X could be 1 or 2.
  • Case 2 - CUNBOPRM_Coll_Level = 4. For this level, you must require at least three times the value of the source (SrcX_Buf_Len * 3), where X could be 1 or 2.
For UCA version UCA400R1 and higher, the following table shows the size of the work buffers for most common UTF-16BE Code Points:
Table 1. Size of the work buffers for UTF-16BE Code Points
Collation Level / Strength Work Buffer length per Code Point in Source buffer
1 4 - Bytes
2 7 - Bytes
3 9 - Bytes
4 12 - Bytes
5 15 - Bytes
Note:

Most common UTF-16BE Code Points require 2-bytes in Source buffer. Non-normal CP's are expansions, contractions, surrogates, surrogates expansions and surrogates contractions.

IBM® recommends allocating the same bytes for work buffer as for target buffer, see Target buffer length considerations. If Collation returns with RC = CUN_RC_USER_ERR, RS = CUN_RS_WRK_EXHAUSTED by following this recommendation (Wrk Buffer Len = Target buffer length), it is recommended to multiply failed work buffer length by 2 and so on.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014