Symbian3/PDK/Source/GUID-5373B575-F284-5774-9C73-2A18C4A912A2.dita
author Graeme Price <GRAEME.PRICE@NOKIA.COM>
Fri, 15 Oct 2010 14:32:18 +0100
changeset 15 307f4279f433
parent 12 80ef3a206772
permissions -rw-r--r--
Initial contribution of the Adaptation Documentation.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
     1
<?xml version="1.0" encoding="utf-8"?>
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
     2
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
     3
<!-- This component and the accompanying materials are made available under the terms of the License 
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
     4
"Eclipse Public License v1.0" which accompanies this distribution, 
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
     5
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
     6
<!-- Initial Contributors:
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
     7
    Nokia Corporation - initial contribution.
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
     8
Contributors: 
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
     9
-->
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    10
<!DOCTYPE concept
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    11
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
12
80ef3a206772 Week 28 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 1897, Bug 344, Bug 2681, Bug 463, Bug 1522.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 9
diff changeset
    12
<concept xml:lang="en" id="GUID-5373B575-F284-5774-9C73-2A18C4A912A2"><title>Using Standard Names and MIB enums (SNM) </title><prolog><metadata><keywords/></metadata></prolog><conbody><p>Internet names, standard names and MIB enums (SNM) are widely used for character sets. This section describes how to use these names and values during character conversion. </p> <section id="GUID-E3BEB74D-79C7-59A9-9366-CCD8B52DB7F8-GENID-1-12-1-31-1-1-4-1-5-1-4-1-6-1-2-2"><p>Before you start, you must understand: </p> <ul><li id="GUID-6834352F-169B-55B6-9A25-7E2D2EFB62E4"><p> <xref scope="external" href="http://www.iana.org/assignments/character-sets">Standard names and MIB enums </xref> (SNM) </p> </li> <li id="GUID-44A0D093-E7DE-5A99-9035-E17FCC0B35EB"><p><xref href="GUID-325D8E31-584B-5B10-902C-F004641A614D.dita">Charconv framework conversion APIs</xref>. </p> </li> </ul> </section> <section><title>Introduction</title> <p>To convert text between a foreign encoding and Unicode you must know the UID of the character converter. </p> <p>Device creators can create files which map SNM information of character sets to the UIDs of their character converters. Application developers can then use the MIB enum value or an alias of a character set without knowing its UID. </p> </section> <section><title>Procedure</title> <p> <b>Creating an SNM source file</b>  </p> <p>Device creators can create an SNM mapping file in the ROM as follows: </p> <ol id="GUID-B3316083-E593-5160-919F-98CED9E8AFDD"><li id="GUID-01555850-9692-5FAD-97CF-F4A2E944C6DA"><p>Create an SNM source file using a text editor on a PC and save it. For example d:\charconvfiles\basicsnm.txt. </p> <p>This file must define the mapping between Symbian-specific character set UIDs and one or more standard names and MIB enums. Refer to <xref href="GUID-CD3B2B7D-BAE5-5F99-A5F5-74AFC678D986.dita">SNM Source File Reference</xref> for the file syntax. For information about Symbian UIDs, refer to the <filepath>charconv.h</filepath> header file. </p> <codeblock id="GUID-7F08B7AD-9AFA-5712-9D3D-AF87F5E9C2D8" xml:space="preserve">
9
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    13
...
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    14
CharacterSet 0x10004cc6
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    15
    StandardName    "US-ASCII"
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    16
    StandardName    "ASCII"
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    17
    StandardName    "ANSI_X3.4-1968"
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    18
    StandardName    "iso-ir-6"
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    19
    StandardName    "ANSI_X3.4-1986"
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    20
    StandardName    "ISO_646.irv:1991"
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    21
    StandardName    "ISO646-US"
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    22
    StandardName    "us"
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    23
    StandardName    "IBM367"
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    24
    StandardName    "cp367"
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    25
    StandardName    "csASCII"
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    26
    MibEnum            3
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    27
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    28
CharacterSet 0x10003b10
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    29
    StandardName    "ISO-8859-1"
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    30
    StandardName    "ISO_8859-1"
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    31
    StandardName    "latin1"
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    32
    StandardName    "iso-ir-100"
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    33
    StandardName    "l1"
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    34
    StandardName    "IBM819"
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    35
    StandardName    "CP819"
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    36
    StandardName    "csISOLatin1"
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    37
    MibEnum            4
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    38
...
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    39
</codeblock> </li> <li id="GUID-65593A6B-21F3-5416-AE81-7D81AB771C95"><p>Use the <codeph>snmtool</codeph> to generate an SNM file from the source SNM file. </p> <p>From a command line, run the following commands to go to the Symbian tools directory and execute <codeph>snmtool</codeph>: </p> <p><userinput>cd d:\Symbian\epoc32\tools</userinput> </p> <p><userinput>snmtool.bat d:\charconvfiles\basicsnm.txt d:\charconvfiles\basic.snm</userinput> </p> </li> <li id="GUID-29001446-1A91-5694-886C-EA57AFEE51EC"><p>Copy the SNM file to the <filepath>\system\charconv\</filepath> directory. </p> </li> </ol> <p> <b>Retrieving a Character Converter UID using an SNM standard name or MIB enum</b>  </p> <ol id="GUID-7A861BDF-B0E8-53F8-B14F-5E69477F79E3"><li id="GUID-0A625B0A-6D8A-5D20-9DB6-E88B7CA83B86"><p>Use an SNM standard name or MIB enum value to retrieve the UID of the character converter. </p> <codeblock id="GUID-A1A41057-D50A-50A5-955E-C59B9B739A5B" xml:space="preserve">RFs fileServerSession;
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    40
CCnvCharacterSetConverter* characterSetConverter = CCnvCharacterSetConverter::NewLC();
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    41
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    42
TUint characterSetUid = 
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    43
    characterSetConverter-&gt;ConvertStandardNameOfCharacterSetToIdentifierL(_L8("ASCII"), fileServerSession);
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    44
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    45
    // use the UID to load the converter.
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    46
CCnvCharacterSetConverter::TAvailability available = 
59758314f811 Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
Dominic Pinkman <dominic.pinkman@nokia.com>
parents: 5
diff changeset
    47
    characterSetConverter-&gt;PrepareToConvertToOrFromL(characterSetUid, fileServerSession);
1
25a17d01db0c Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    48
...</codeblock> </li> </ol> <p>There are two functions for getting a UID: </p> <ul><li id="GUID-B5DC4C12-C0F6-5A66-B4EA-68A154F777FA"><p> <codeph>CCnvCharacterSetConverter::ConvertStandardNameOfCharacterSetToIdentifierL()</codeph> takes a standard name as a parameter. </p> </li> <li id="GUID-E0F345C4-22D9-5090-B4C2-97071EBBB49A"><p> <codeph>CCnvCharacterSetConverter::ConvertMibEnumOfCharacterSetToIdentifierL()</codeph> takes a MIB enum value as a parameter. </p> </li> </ul> <p>These functions read the SNM file to get the UID. The UID can then be passed to <codeph>PrepareToConvertToOrFromL()</codeph> to load the right converter. </p> <p> <b>Note</b>: If there are multiple SNM files, the contents are combined. </p> </section> </conbody></concept>