ILE C/C++ Compiler Reference


convert

C compiler C++ compiler
Read syntax diagramSkip visual syntax diagramconvert syntax
 
>>-#--pragma--convert--(--ccsid--)-----------------------------><
 

Description

Specifies the Coded Character Set Identifier (CCSID) to use for converting the string literals from that point onward in a source file during compilation. The conversion continues until the end of the source file or until another #pragma convert directive is specified. Use #pragma convert (0) to disable the previous #pragma convert directive. The CCSID of the string literals before conversion is the same CCSID as the root source member. CCSIDs 905 and 1026 are not supported. The CCSID can be either EBCDIC or ASCII.

Parameters

ccsid
Specifies the coded character set identifier to use for converting the strings and literals in the source file. The value can be 0 - 65535. See the ILE C/C++ Runtime Library Functions manual for more information about code pages.

Notes® on Usage

By default, runtime library functions that parse format strings (such as printf() and scanf()) expect the format strings to be coded in CCSID 37. If the LOCALETYPE(*LOCALEUTF) compile option is specified, then the runtime library functions expect the format strings to be coded in the CCSID of the last locale set in the program (or UTF-8 if the program does not set the locale).

String and character constants that are specified in hex, for example (0xC1), are not converted.

Substitution characters are not used when converting to a target CCSID that does not contain the same symbol set as the source CCSID. The compilation fails.

If a CCSID with the value 65535 is specified, the CCSID of the root source member is assumed. If the source file CCSID value is 65535, the job CCSID is assumed for the source file. If the file CCSID is 65535 and the job CCSID is not 65535, the job CCSID is assumed for the file CCSID. If the file is 65535 and the job is also 65535, but the system CCSID value is not 65535, the system CCSID value is assumed for the file CCSID. If the file, job and system CCSID values are 65535, CCSID 037 is assumed.

If the LOCALETYPE(*LOCALEUCS2) compiler option is specified, wide-character literals are not converted. See Using Unicode Support for Wide-Character Literals in IBM® Rational® Developer for i: ILE C/C++ Programmer's Guide for more information.


[ Top of Page | Previous Page | Next Page | Contents | Index ]