Table of Contents Previous Next
Logo
Client-Side Slice-to-Python Mapping : 18.6 Mapping for Simple Built‑In Types
Copyright © 2003-2008 ZeroC, Inc.

18.6 Mapping for Simple Built‑In Types

The Slice built‑in types are mapped to Python types as shown in Table 18.1.
Table 18.1. Mapping of Slice built‑in types to Python.
Although Python supports arbitrary precision in its integer types, the Ice run time validates integer values to ensure they have valid ranges for their declared Slice types.

18.6.1 String Mapping

String values returned as the result of a Slice operation (including return values, out parameters, and data members) are always represented as instances of Python’s 8-bit string type. These string values contain UTF-8 encoded strings unless the program has installed a string converter, in which case string values use the converter’s native encoding instead. See Section 28.23 for more information on string converters.
Legal string input values for a remote Slice operation are shown below:
• None
Ice marshals an empty string whenever None is encountered.
• 8-bit string objects
Ice assumes that all 8-bit string objects contain valid UTF-8 encoded strings unless the program has installed a string converter, in which case Ice assumes that 8-bit string objects use the native encoding expected by the converter.
• Unicode objects
Ice converts a Unicode object into UTF-8 and marshals it directly. If a string converter is installed, it is not invoked for Unicode objects.
Table of Contents Previous Next
Logo