NewFromEbcdicCodepage (CharacterToUnicodeMap function): Difference between revisions
m (→Syntax terms) |
m (→Usage notes) |
||
Line 19: | Line 19: | ||
<ul> | <ul> | ||
<li><var>NewFromEbcdicCodepage</var> is a [[Object variables#Virtual Constructor methods|virtual constructor]] and as such can be called with no method object, with an explicit class name, or with an object variable, even if that object is null: | <li><var>NewFromEbcdicCodepage</var> is a [[Object variables#Virtual Constructor methods|virtual constructor]] and as such can be called with no method object, with an explicit class name, or with an object variable, even if that object is null: | ||
<p class="code">%charToUmap = newFromEbcdicCodepage( | <p class="code">%charToUmap = newFromEbcdicCodepage('0037EXT') | ||
%charToUmap = %(CharacterToUnicodeMap):newFromEbcdicCodepage( | %charToUmap = %(CharacterToUnicodeMap):newFromEbcdicCodepage('0037EXT') | ||
%charToUmap = %charToUmap:newFromEbcdicCodepage( | %charToUmap = %charToUmap:newFromEbcdicCodepage('0037EXT') | ||
</p> | </p> | ||
</ul> | </ul> |
Revision as of 22:56, 30 November 2011
Create CharacterToUnicodeMap object from EBCDIC codepage (CharacterToUnicodeMap class)
[Introduced in Sirius Mods 8.0]
This method lets you dynamically select a particular codepage for specific data without
having to change your system-wide codepage.
Syntax
%characterToUnicodeMap = [%(CharacterToUnicodeMap):]NewFromEbcdicCodepage[( [codepageName])]
Syntax terms
%CharacterToUnicodeMap | A CharacterToUnicodeMap object. |
---|---|
[%(CharacterToUnicodeMap):] | The optional class name in parentheses denotes a virtual constructor. See "Usage notes", below, for more information about invoking a virtual constructor. |
codepageName | A string that identifies one of the currently supported codepages at your site. You can view (and manage) these codepages with the UNICODE command. |
Usage notes
- NewFromEbcdicCodepage is a virtual constructor and as such can be called with no method object, with an explicit class name, or with an object variable, even if that object is null:
%charToUmap = newFromEbcdicCodepage('0037EXT') %charToUmap = %(CharacterToUnicodeMap):newFromEbcdicCodepage('0037EXT') %charToUmap = %charToUmap:newFromEbcdicCodepage('0037EXT')
Examples
The following code sequence shows the use of a Sirius Mods extended codepage, which maps the EBCDIC X'20' character (normally not translatable to Unicode) to the Unicode character U+20AC (the Euro sign):
%tr is object characterToUnicodeMap %tr = newFromEbcdicCodepage('0285EXT') %u = ('20':x):characterToUnicode(%tr) Printtext {~} is {%u:UnicodeToUtf16:StringToHex}
The result is: %u2:UnicodeToUtf16:StringToHex is 20AC