CHARMAP property (System)
Description
This property contains a conversion map to use when processing string values (not object and property names) passed to and from the Presentation Server. It swaps specified characters with other characters before storing them in the database, and converts them back before displaying them.
In ANSI applications this can be useful when using a language that supports characters that conflict with the system delimiters, such as the " ý" character (code 253). Under normal circumstances this would be treated as an @vm delimiter (code 253) which might corrupt a structure or a multivalued array. Using CHARMAP it is possible to map this to an "unused" character like "§" (code 167) instead and preserve the integrity of the program when the value is fetched from the PS.
Property Value
This property is a 510-character string.
The first 255 characters are the "get-map". When set, the value from each character in a property value is compared to its position in the get-map. It is then swapped with the get-map character at that position during "Get_Property" type operations.
The latter 255 characters are the "set-map". When set, the value from each character in a property value is compared to its position in the set-map. It is then swapped with the set-map character at that position during "Set_Property" type operations.
Property Traits
Development | Runtime | Indexed | Scaled | Synthetic |
---|---|---|---|---|
N/A | Get/Set | No | No | No |
Remarks
This property is considered to be deprecated and is supported for backwards compatibility only. New applications that require internationalization support should be designed as UTF8-aware applications instead.
Note that CHARMAP-converted strings stored in the database must be converted back if they are to be used with other tools outside of the Presentation Server. This includes data that is exported to files, or is accessed directly via methods that use RevCAPI, like web-applications and the EngineServer.
CHARMAP cannot be set for the SYSPROG application.
Example
Equ FIRST_UNUSED_CHAR$ To 129 Map = Get_Property( "SYSTEM", "CHARMAP" ) MapGet = Map[1,255] MapSet = Map[256,255] // Let's map six system delimiters (@Stm, @Tm, @Svm, @Vm, @Fm, @Rm) // to the unused area starting at FIRST_UNUSED_CHAR$ For Ctr = 0 To 5 MapGet[Seq( @Stm ) + Ctr, 1] = Char( FIRST_UNUSED_CHAR$ + Ctr ) Next For Ctr = 0 to 5 MapSet[FIRST_UNUSED_CHAR$ + Ctr, 1] = Char(Seq( @Stm ) + Ctr ) Next Call Set_Property( "SYSTEM", "CHARMAP", mapGet : mapSet )
See Also
DELIMCOUNT property, UTF8 property, Appendix I - UTF8 Processing