Symbian3/SDK/Source/GUID-A8F13E5A-56F2-5C72-AF81-5AC062B94C6C.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Tue, 20 Jul 2010 12:00:49 +0100
changeset 13 48780e181b38
parent 7 51a74ef9ed63
permissions -rw-r--r--
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-A8F13E5A-56F2-5C72-AF81-5AC062B94C6C" xml:lang="en"><title>Using
URI Utilities </title><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>This tutorial describes the steps to use URI utilities. </p>
<section><title>Introduction</title><p><xref href="GUID-265F8D6B-4B88-342A-BD7B-5934CC9437DA.dita"><apiname>UriUtils</apiname></xref> class checks
URIs for invalid characters and has both 8 and 16-bit variants. It provides
additional utilities for <xref href="GUID-E6F8C94C-C74C-329B-BB11-E06F0E83A4BB.dita"><apiname>CUri8</apiname></xref> and <xref href="GUID-3B5EC759-81D3-3A5E-B437-7AA3BD3124BA.dita"><apiname>CAuthority8</apiname></xref> classes.
The method used to check URIs is <codeph>HasValidChars()</codeph>, which is
passed through descriptor data to check and return a boolean indicating whether
invalid characters were found or not. </p><p>You can create URI (<xref href="GUID-E6F8C94C-C74C-329B-BB11-E06F0E83A4BB.dita"><apiname>CUri8</apiname></xref> object)
from a Unicode descriptor using <xref href="GUID-265F8D6B-4B88-342A-BD7B-5934CC9437DA.dita#GUID-265F8D6B-4B88-342A-BD7B-5934CC9437DA/GUID-8A9C278B-8DF6-3C5A-ADCB-8434B6DB6DFF"><apiname>UriUtils::CreateUriL()</apiname></xref>.
Refer to <xref href="GUID-4D32A29F-6573-5233-8982-BDEEDDB4F0FF.dita">Creating an
URI</xref> for details. </p> </section>
<section><title>Validating URI for invalid characters</title><p> <xref href="GUID-EE23B21A-5198-3087-91D1-2332CE40B6CA.dita"><apiname>HasInvalidChars()</apiname></xref> checks
for any excluded (also called invalid) characters in the URI to validate the
invalid characters. The following are set of invalid characters: </p> <table id="GUID-6FF08B48-1395-58B7-B9EA-15D89A52F931">
<tgroup cols="2"><colspec colname="col0"/><colspec colname="col1"/>
<thead>
<row>
<entry>Category</entry>
<entry>Character set</entry>
</row>
</thead>
<tbody>
<row>
<entry><p>Control characters </p> </entry>
<entry><p>Values <codeph>0x00</codeph> to <codeph>0x1F</codeph> and greater
than <codeph>0x7F</codeph>  </p> </entry>
</row>
<row>
<entry><p>Space </p> </entry>
<entry><p> <codeph>0x20</codeph>  </p> </entry>
</row>
<row>
<entry><p>Delimiters </p> </entry>
<entry><p>'&lt;', '&gt;', '#', '%', '"' </p> </entry>
</row>
<row>
<entry><p>Unwise characters </p> </entry>
<entry><p>' {', '}', '|', '\', '^', '[', ']', '`' </p> </entry>
</row>
</tbody>
</tgroup>
</table> </section>
<section><title>Validating URI for valid host </title><p><codeph>HostType()</codeph> validates
the URI for the following valid host types as defined in <xref href="GUID-79125D4F-A803-36E7-AB56-D8ACB80D5FFE.dita"><apiname>TUriHostType</apiname></xref>:</p><ul>
<li><p>IPv6, for example, <userinput>1080:0:0:0:8:800:200C:417A</userinput></p></li>
<li><p>IPv4, for example, <userinput>192.168.202.18</userinput></p></li>
<li><p>Text form, for example, <userinput>www.mywebpage.com</userinput> </p></li>
</ul></section>
</conbody><related-links>
<link href="GUID-795B41AF-FBEA-56CE-AE20-EF17BE754723.dita"><linktext>HTTP Utilities
Library Overview</linktext></link>
<link href="GUID-4D32A29F-6573-5233-8982-BDEEDDB4F0FF.dita"><linktext>Creating
an URI</linktext></link>
</related-links></concept>