Jump to content

UniSetUconvObject: Difference between revisions

From EDM2
m formatting
Ak120 (talk | contribs)
mNo edit summary
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== UniSetUconvObject ==
Set the attributes of a conversion object.
; UniSetUconvObject(uconvObj, uconvAttr) : Set the attributes of a conversion object.
 
=== Syntax ===
UniSetUconvObject(uconvObj, uconvAttr) ;


=== Parameters ===
=== Parameters ===
; uconvObj - [[OS2 API:DataType:UconvObject|UconvObject]] - input : The conversion object created from [[OS2_API:UniCreateUconvObject|UniCreateUconvObject]].
; uconvObj - [[UconvObject]] - input : The conversion object created from [[UniCreateUconvObject]].
;uconvAttr - [[OS2 API:DataType:uconv_attribute_t|uconv_attribute_t]] - input : The conversion object attributes.
;uconvAttr - [[uconv_attribute_t]] - input : The conversion object attributes.
 
==== options ====
==== options ====
; options : Substitution options can be:
; options : Substitution options can be:
* [[OS2_API:Constant:UCONV#UCONV_OPTION_SUBSTITUTION_BOTH|UCONV_OPTION_SUBSTITUTION_BOTH]]
* [[UCONV#UCONV_OPTION_SUBSTITUTION_BOTH|UCONV_OPTION_SUBSTITUTION_BOTH]]
* [[OS2_API:Constant:UCONV#UCONV_OPTION_SUBSTITUTION_FROM_UNICODE|UCONV_OPTION_SUBSTITUTION_FROM_UNICODE]]
* [[UCONV#UCONV_OPTION_SUBSTITUTION_FROM_UNICODE|UCONV_OPTION_SUBSTITUTION_FROM_UNICODE]]
* [[OS2_API:Constant:UCONV#UCONV_OPTION_SUBSTITUTION_TO_UNICODE|UCONV_OPTION_SUBSTITUTION_TO_UNICODE]]
* [[UCONV#UCONV_OPTION_SUBSTITUTION_TO_UNICODE|UCONV_OPTION_SUBSTITUTION_TO_UNICODE]]


; endian : Source and target endian.  Source applies to [[OS2_API:UniUconvFromUcs|UniUconvFromUcs]]; target applies to [[OS2_API:UniUconvToUcs|UniUconvToUcs]].
; endian : Source and target endian.  Source applies to [[UniUconvFromUcs]]; target applies to [[UniUconvToUcs]].
* 0x000 Use system endian.
* 0x000 Use system endian.
* 0xfeff Use big endian.
* 0xfeff Use big endian.
Line 17: Line 20:


; displaymask : 32 bit display and data mask.  Each bit represents a control character below space (1<<char).  The bit being a zero the character represents a glyph.  The bit being one the character represents a control.
; displaymask : 32 bit display and data mask.  Each bit represents a control character below space (1<<char).  The bit being a zero the character represents a glyph.  The bit being one the character represents a control.
* [[OS2_API:Constant:DSPMASK#DSPMASK_CRLF|DSPMASK_CRLF]]
* [[DSPMASK#DSPMASK_CRLF|DSPMASK_CRLF]]
* [[OS2_API:Constant:DSPMASK#DSPMASK_DATA|DSPMASK_DATA]]
* [[DSPMASK#DSPMASK_DATA|DSPMASK_DATA]]
* [[OS2_API:Constant:DSPMASK#DSPMASK_DISPLAY|DSPMASK_DISPLAY]]
* [[DSPMASK#DSPMASK_DISPLAY|DSPMASK_DISPLAY]]
 
; converttype : Conversion flags which can be ORed together.
; converttype : Conversion flags which can be ORed together.
* [[OS2_API:Constant:CVTTYPE#CVTTYPE_CDRA|CVTTYPE_CDRA]]
* [[CVTTYPE#CVTTYPE_CDRA|CVTTYPE_CDRA]]
* [[OS2_API:Constant:CVTTYPE#CVTTYPE_CTRL7F|CVTTYPE_CTRL7F]]
* [[CVTTYPE#CVTTYPE_CTRL7F|CVTTYPE_CTRL7F]]
* [[OS2_API:Constant:CVTTYPE#CVTTYPE_PATH|CVTTYPE_PATH]]
* [[CVTTYPE#CVTTYPE_PATH|CVTTYPE_PATH]]
 
; subchar_len : Code page substitution length whose value is from 1 to and including 13.  A value of 0 the substitution character from the conversion table should be used.
; subchar_len : Code page substitution length whose value is from 1 to and including 13.  A value of 0 the substitution character from the conversion table should be used.
; subchar : Substitution bytes.
; subchar : Substitution bytes.
; subuni_len : Unicode substitution length whose value can be 0 or 1.  A value of 0 the Unicode substitution should come from the conversion table.
; subuni_len : Unicode substitution length whose value can be 0 or 1.  A value of 0 the Unicode substitution should come from the conversion table.
; subuni : If subuni_len is 1, the first element is the Unicode substitution character.
; subuni : If subuni_len is 1, the first element is the Unicode substitution character.
; state : When set to 0, the conversion object is put into its base conversion state.
; state : When set to 0, the conversion object is put into its base conversion state.
=== Constants ===


=== Returns ===
=== Returns ===
An integer with values of:
An integer with values of:
* [[OS2 API:Unicode:error#UCONV_EINVAL|UCONV_EINVAL]]
<!--
* [[OS2 API:Unicode:error#ULS_SUCCESS|ULS_SUCCESS]]
* [[Unicode Errors#UCONV_EINVAL|UCONV_EINVAL]]
-->
* [[Unicode Errors#ULS_BADATTR|ULS_BADATTR]]
* [[Unicode Errors#ULS_SUCCESS|ULS_SUCCESS]]


=== Module ===
=== Calling Convention ===
 
=== Define (C/C++) ===
 
=== Export name/Ordinal ===
 
=== Calling conversion ===
[[Cdecl32]]
[[Cdecl32]]


=== Example Code ===
=== Example Code ===
  [[OS2 API:DataType:UconvObject|UconvObject]]       uconvObj;
  UconvObject      uconvObj;
  [[OS2 API:DataType:uconv_attribute_t|uconv_attribute_t]] uconvAttr;
  uconv_attribute_t uconvAttr;
  integer          rc;
  integer          rc;
  ...
  ...
Line 62: Line 53:


=== Related Functions ===
=== Related Functions ===
[[OS2 API:UniCreateUconvObject|UniCreateUconvObject]]
*[[UniCreateUconvObject]]
[[OS2 API:UniFreeUconvObject|UniFreeUconvObject]]
*[[UniFreeUconvObject]]
[[OS2 API:UniQueryUconvObject|UniQueryUconvObject]]
*[[UniQueryUconvObject]]


=== Notes ===
=== Notes ===
[[OS2 API:UniSetUconvObject|UniSetUconvObject]] sets the attributes of the conversion object. The given attributes are used to modify the default conversion. It is left up to each conversion to decide which attributes it will recognize.
'''UniSetUconvObject''' sets the attributes of the conversion object. The given attributes are used to modify the default conversion. It is left up to each conversion to decide which attributes it will recognize.


The substitution character attribute specifies to the conversion object what to do when this is no identical character for a given code element.
The substitution character attribute specifies to the conversion object what to do when this is no identical character for a given code element.
Line 73: Line 64:
=== OS Version Introduced ===
=== OS Version Introduced ===
OS/2 Warp
OS/2 Warp
[[Category:Uni]]

Latest revision as of 18:05, 4 December 2019

Set the attributes of a conversion object.

Syntax

UniSetUconvObject(uconvObj, uconvAttr) ;

Parameters

uconvObj - UconvObject - input
The conversion object created from UniCreateUconvObject.
uconvAttr - uconv_attribute_t - input
The conversion object attributes.

options

options
Substitution options can be:
endian
Source and target endian. Source applies to UniUconvFromUcs; target applies to UniUconvToUcs.
  • 0x000 Use system endian.
  • 0xfeff Use big endian.
  • 0xffff Use little endian.
displaymask
32 bit display and data mask. Each bit represents a control character below space (1<<char). The bit being a zero the character represents a glyph. The bit being one the character represents a control.
converttype
Conversion flags which can be ORed together.
subchar_len
Code page substitution length whose value is from 1 to and including 13. A value of 0 the substitution character from the conversion table should be used.
subchar
Substitution bytes.
subuni_len
Unicode substitution length whose value can be 0 or 1. A value of 0 the Unicode substitution should come from the conversion table.
subuni
If subuni_len is 1, the first element is the Unicode substitution character.
state
When set to 0, the conversion object is put into its base conversion state.

Returns

An integer with values of:

Calling Convention

Cdecl32

Example Code

UconvObject       uconvObj;
uconv_attribute_t uconvAttr;
integer           rc;
...
rc = UniSetUconvObject(uconvObj, uconvAttr);
...

Related Functions

Notes

UniSetUconvObject sets the attributes of the conversion object. The given attributes are used to modify the default conversion. It is left up to each conversion to decide which attributes it will recognize.

The substitution character attribute specifies to the conversion object what to do when this is no identical character for a given code element.

OS Version Introduced

OS/2 Warp