1<!DOCTYPE HTML PUBLIC "-//W3C//Dtd HTML 4.01 Transitional//EN">
2<html>
3<head>
4<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
5<meta http-equiv="Content-Style-Type" content="text/css" />
6<link rel="stylesheet" type="text/css" href="../../CSS/revolution.css" />
7<title>ENCCheckEncoding</title>
8</head>
9
10<body>
11
12<h1>ENCCheckEncoding</h1>
13
14
15<h2>Syntax</h2>
16<dl><dd><pre class="construction">
17#include &lt;revolution/enc.h&gt;
18
19ENCResult ENCCheckEncoding(s32* index, const u8** encodings, s32 encsize, const u16* src, s32 srclen);
20</pre></dd></dl>
21
22<h2>Arguments</h2>
23<TABLE class="arguments" border="1" >
24    <tr>
25<th>index</th>
26<td>Stores the array index of the convertible character encoding. If a convertible character encoding is not found, <code>ENC_CHECK_NOT_FOUND</code> will be stored.</td>
27    </tr>
28    <tr>
29<th>encodings</th>
30<td>Array of conversion candidate character encoding.<br>Specifies the array of character encoding name string expression.</td>
31    </tr>
32    <tr>
33<th>encsize</th>
34<td>Array size of conversion candidate character encoding.<br>Maximum specifiable count is defined as <code>ENC_ENCODING_COUNT</code>.</td>
35    </tr>
36    <tr>
37<th>src</th>
38<td>Buffer of checked internal encoding string.</td>
39    </tr>
40    <tr>
41<th>srclen</th>
42<td>Buffer size of checked internal encoding string. A string larger than specified by <CODE>srclen</CODE> will not be read.<br>If <SPAN class="argument">srclen</SPAN> is <CODE>NULL</CODE> or a negative value, <SPAN class="argument">src</SPAN class="argument"> will be loaded until the termination character is found.<br>If <SPAN class="argument">srclen</SPAN> is not <CODE>NULL</CODE>, it will store the size of the loaded string buffer.</td>
43    </tr>
44</table>
45
46<h2>Return Values</h2>
47<p>
48<code>ENC_OK</code>: Normal exit.<br><code>ENC_ERR_INVALID_PARAM</code>: Invalid argument.<br><code>ENC_ERR_UNKNOWN_ENCODING</code>: Unknown character encoding.<br><code>ENC_ERR_UNSUPPORTED</code>: Unsupported character code conversion.<br>
49</p>
50
51<h2>Description</h2>
52<p>Determines the convertible character encoding from the internal encoding.</p>
53<p>In <SPAN class="argument">encodings</SPAN>, specify the array of strings that represents character encoding of conversion candidates; in <SPAN class="argument">encsize</SPAN>, specify the array's size. If a non-recognizable character encoding is specified, the corresponding encoding name index is stored in <SPAN class="argument">index</SPAN> and <code>ENC_ERR_UNKNOWN_ENCODING</code> is returned. If an unsupported conversion of character code is specified, the corresponding encoding name index is stored in <SPAN class="argument">index</SPAN> and <code>ENC_ERR_UNSUPPORTED</code> is returned.</p>
54<p>Convertibility is determined in the character encoding order specified in <SPAN class="argument">encodings</SPAN>; the array index of the first found character encoding is stored in <SPAN class="argument">index</SPAN>. If a convertible character encoding is not found, <code>ENC_CHECK_NOT_FOUND</code> will be stored in <SPAN class="argument">index</SPAN>.</p>
55<p><font color="ff0000"><SPAN class="argument">srclen</SPAN> is the byte conversion buffer size.</font></p>
56<p><b><code>ENC_ERR_NOT_LOADED</code> was eliminated in RevolutionSDK 3.2.</b><br>If you specify a character encoding whose conversion table has been stripped, this function will return <code>ENC_ERR_UNSUPPORTED</code>.</p>
57
58<h2>See Also</h2>
59<p>
60None.
61</p>
62
63<h2>Revision History</h2>
64<p>
652008/03/31 Eliminated <code>ENC_ERR_NOT_LOADED</code>.<br>2007/02/05 Added <CODE>ENC_ERR_NOT_LOADED</CODE>.<br>2006/10/19 Initial version.<br>
66</p>
67
68<hr><p>CONFIDENTIAL</p></body>
69</html>