<!-- This comment will put IE 6, 7 and 8 in quirks mode --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>ICU 4.4.1: ucsdet.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javaScript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body onload='searchBox.OnSelectItem(0);'> <!-- Generated by Doxygen 1.6.2-20100208 --> <script type="text/javascript"><!-- var searchBox = new SearchBox("searchBox", "search",false,'Search'); --></script> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <img id="MSearchSelect" src="search/search.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </div> </li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> <h1>ucsdet.h</h1><a href="ucsdet_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment"> **********************************************************************</span> <a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2005-2009, International Business Machines</span> <a name="l00004"></a>00004 <span class="comment"> * Corporation and others. All Rights Reserved.</span> <a name="l00005"></a>00005 <span class="comment"> **********************************************************************</span> <a name="l00006"></a>00006 <span class="comment"> * file name: ucsdet.h</span> <a name="l00007"></a>00007 <span class="comment"> * encoding: US-ASCII</span> <a name="l00008"></a>00008 <span class="comment"> * indentation:4</span> <a name="l00009"></a>00009 <span class="comment"> *</span> <a name="l00010"></a>00010 <span class="comment"> * created on: 2005Aug04</span> <a name="l00011"></a>00011 <span class="comment"> * created by: Andy Heninger</span> <a name="l00012"></a>00012 <span class="comment"> *</span> <a name="l00013"></a>00013 <span class="comment"> * ICU Character Set Detection, API for C</span> <a name="l00014"></a>00014 <span class="comment"> *</span> <a name="l00015"></a>00015 <span class="comment"> * Draft version 18 Oct 2005</span> <a name="l00016"></a>00016 <span class="comment"> *</span> <a name="l00017"></a>00017 <span class="comment"> */</span> <a name="l00018"></a>00018 <a name="l00019"></a>00019 <span class="preprocessor">#ifndef __UCSDET_H</span> <a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#define __UCSDET_H</span> <a name="l00021"></a>00021 <span class="preprocessor"></span> <a name="l00022"></a>00022 <span class="preprocessor">#include "<a class="code" href="utypes_8h.html" title="Basic definitions for ICU, for both C and C++ APIs.">unicode/utypes.h</a>"</span> <a name="l00023"></a>00023 <a name="l00024"></a>00024 <span class="preprocessor">#if !UCONFIG_NO_CONVERSION</span> <a name="l00025"></a>00025 <span class="preprocessor"></span> <a name="l00026"></a>00026 <span class="preprocessor">#include "<a class="code" href="localpointer_8h.html" title="C++ API: &quot;Smart pointers&quot; for use with and in ICU4C C++ code.">unicode/localpointer.h</a>"</span> <a name="l00027"></a>00027 <span class="preprocessor">#include "<a class="code" href="uenum_8h.html" title="C API: String Enumeration.">unicode/uenum.h</a>"</span> <a name="l00028"></a>00028 <a name="l00049"></a>00049 <span class="keyword">struct </span><a class="code" href="ucsdet_8h.html#a8f341f9c43bf58b112afd70c8a94c45d" title="Structure representing a charset detector.">UCharsetDetector</a>; <a name="l00054"></a><a class="code" href="ucsdet_8h.html#a8f341f9c43bf58b112afd70c8a94c45d">00054</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="ucsdet_8h.html#a8f341f9c43bf58b112afd70c8a94c45d" title="Structure representing a charset detector.">UCharsetDetector</a> <a class="code" href="ucsdet_8h.html#a8f341f9c43bf58b112afd70c8a94c45d" title="Structure representing a charset detector.">UCharsetDetector</a>; <a name="l00055"></a>00055 <a name="l00056"></a>00056 <span class="keyword">struct </span><a class="code" href="ucsdet_8h.html#a4e40a6a6dae057f9257e144fc65ba667" title="Opaque structure representing a match that was identified from a charset detection...">UCharsetMatch</a>; <a name="l00062"></a><a class="code" href="ucsdet_8h.html#a4e40a6a6dae057f9257e144fc65ba667">00062</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="ucsdet_8h.html#a4e40a6a6dae057f9257e144fc65ba667" title="Opaque structure representing a match that was identified from a charset detection...">UCharsetMatch</a> <a class="code" href="ucsdet_8h.html#a4e40a6a6dae057f9257e144fc65ba667" title="Opaque structure representing a match that was identified from a charset detection...">UCharsetMatch</a>; <a name="l00063"></a>00063 <a name="l00072"></a>00072 <a class="code" href="umachine_8h.html#af3e3799716eaa41e3f49c7bf18c62b98" title="This is used to declare a function as a stable public ICU C API.">U_STABLE</a> <a class="code" href="ucsdet_8h.html#a8f341f9c43bf58b112afd70c8a94c45d" title="Structure representing a charset detector.">UCharsetDetector</a> * <a class="code" href="platform_8h.html#a72bf6d8ec0640a37b1915e5d853b2016">U_EXPORT2</a> <a name="l00073"></a>00073 <a class="code" href="ucsdet_8h.html#abf2d3c7b731982895433cfbeb6c29cdd" title="Open a charset detector.">ucsdet_open</a>(<a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c" title="Error code to replace exception handling, so that the code is compatible with all...">UErrorCode</a> *status); <a name="l00074"></a>00074 <a name="l00084"></a>00084 <a class="code" href="umachine_8h.html#af3e3799716eaa41e3f49c7bf18c62b98" title="This is used to declare a function as a stable public ICU C API.">U_STABLE</a> <span class="keywordtype">void</span> <a class="code" href="platform_8h.html#a72bf6d8ec0640a37b1915e5d853b2016">U_EXPORT2</a> <a name="l00085"></a>00085 <a class="code" href="ucsdet_8h.html#a84dab4d2c56fedb624a01db170ba698c" title="Close a charset detector.">ucsdet_close</a>(<a class="code" href="ucsdet_8h.html#a8f341f9c43bf58b112afd70c8a94c45d" title="Structure representing a charset detector.">UCharsetDetector</a> *ucsd); <a name="l00086"></a>00086 <a name="l00087"></a>00087 <span class="preprocessor">#if U_SHOW_CPLUSPLUS_API</span> <a name="l00088"></a>00088 <span class="preprocessor"></span> <a name="l00089"></a>00089 <a class="code" href="uversion_8h.html#a7d9374e037299886d4192b763b4c5e8b" title="This is used to begin a declaration of a public ICU C++ API.">U_NAMESPACE_BEGIN</a> <a name="l00090"></a>00090 <a name="l00100"></a>00100 U_DEFINE_LOCAL_OPEN_POINTER(LocalUCharsetDetectorPointer, <a class="code" href="ucsdet_8h.html#a8f341f9c43bf58b112afd70c8a94c45d" title="Structure representing a charset detector.">UCharsetDetector</a>, <a class="code" href="ucsdet_8h.html#a84dab4d2c56fedb624a01db170ba698c" title="Close a charset detector.">ucsdet_close</a>); <a name="l00101"></a>00101 <a name="l00102"></a>00102 <a class="code" href="uversion_8h.html#a3da1f00f3b02976ac53c014a3e4c0933" title="This is used to end a declaration of a public ICU C++ API.">U_NAMESPACE_END</a> <a name="l00103"></a>00103 <a name="l00104"></a>00104 <span class="preprocessor">#endif</span> <a name="l00105"></a>00105 <span class="preprocessor"></span> <a name="l00121"></a>00121 <a class="code" href="umachine_8h.html#af3e3799716eaa41e3f49c7bf18c62b98" title="This is used to declare a function as a stable public ICU C API.">U_STABLE</a> <span class="keywordtype">void</span> <a class="code" href="platform_8h.html#a72bf6d8ec0640a37b1915e5d853b2016">U_EXPORT2</a> <a name="l00122"></a>00122 <a class="code" href="ucsdet_8h.html#abb128d8c30fd92d47110a3ca3499c5b2" title="Set the input byte data whose charset is to detected.">ucsdet_setText</a>(<a class="code" href="ucsdet_8h.html#a8f341f9c43bf58b112afd70c8a94c45d" title="Structure representing a charset detector.">UCharsetDetector</a> *ucsd, <span class="keyword">const</span> <span class="keywordtype">char</span> *textIn, int32_t len, <a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c" title="Error code to replace exception handling, so that the code is compatible with all...">UErrorCode</a> *status); <a name="l00123"></a>00123 <a name="l00124"></a>00124 <a name="l00143"></a>00143 <a class="code" href="umachine_8h.html#af3e3799716eaa41e3f49c7bf18c62b98" title="This is used to declare a function as a stable public ICU C API.">U_STABLE</a> <span class="keywordtype">void</span> <a class="code" href="platform_8h.html#a72bf6d8ec0640a37b1915e5d853b2016">U_EXPORT2</a> <a name="l00144"></a>00144 <a class="code" href="ucsdet_8h.html#a94e2837151f289f01977a211c8a8e06f" title="Set the declared encoding for charset detection.">ucsdet_setDeclaredEncoding</a>(<a class="code" href="ucsdet_8h.html#a8f341f9c43bf58b112afd70c8a94c45d" title="Structure representing a charset detector.">UCharsetDetector</a> *ucsd, <span class="keyword">const</span> <span class="keywordtype">char</span> *encoding, int32_t length, <a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c" title="Error code to replace exception handling, so that the code is compatible with all...">UErrorCode</a> *status); <a name="l00145"></a>00145 <a name="l00146"></a>00146 <a name="l00172"></a>00172 <a class="code" href="umachine_8h.html#af3e3799716eaa41e3f49c7bf18c62b98" title="This is used to declare a function as a stable public ICU C API.">U_STABLE</a> <span class="keyword">const</span> <a class="code" href="ucsdet_8h.html#a4e40a6a6dae057f9257e144fc65ba667" title="Opaque structure representing a match that was identified from a charset detection...">UCharsetMatch</a> * <a class="code" href="platform_8h.html#a72bf6d8ec0640a37b1915e5d853b2016">U_EXPORT2</a> <a name="l00173"></a>00173 <a class="code" href="ucsdet_8h.html#aff2633b5055d472cff4108d94f97cf7d" title="Return the charset that best matches the supplied input data.">ucsdet_detect</a>(<a class="code" href="ucsdet_8h.html#a8f341f9c43bf58b112afd70c8a94c45d" title="Structure representing a charset detector.">UCharsetDetector</a> *ucsd, <a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c" title="Error code to replace exception handling, so that the code is compatible with all...">UErrorCode</a> *status); <a name="l00174"></a>00174 <a name="l00175"></a>00175 <a name="l00206"></a>00206 <a class="code" href="umachine_8h.html#af3e3799716eaa41e3f49c7bf18c62b98" title="This is used to declare a function as a stable public ICU C API.">U_STABLE</a> <span class="keyword">const</span> <a class="code" href="ucsdet_8h.html#a4e40a6a6dae057f9257e144fc65ba667" title="Opaque structure representing a match that was identified from a charset detection...">UCharsetMatch</a> ** <a class="code" href="platform_8h.html#a72bf6d8ec0640a37b1915e5d853b2016">U_EXPORT2</a> <a name="l00207"></a>00207 <a class="code" href="ucsdet_8h.html#a307dfacd517a92891d1f98d513429bda" title="Find all charset matches that appear to be consistent with the input, returning an...">ucsdet_detectAll</a>(<a class="code" href="ucsdet_8h.html#a8f341f9c43bf58b112afd70c8a94c45d" title="Structure representing a charset detector.">UCharsetDetector</a> *ucsd, int32_t *matchesFound, <a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c" title="Error code to replace exception handling, so that the code is compatible with all...">UErrorCode</a> *status); <a name="l00208"></a>00208 <a name="l00209"></a>00209 <a name="l00210"></a>00210 <a name="l00226"></a>00226 <a class="code" href="umachine_8h.html#af3e3799716eaa41e3f49c7bf18c62b98" title="This is used to declare a function as a stable public ICU C API.">U_STABLE</a> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="platform_8h.html#a72bf6d8ec0640a37b1915e5d853b2016">U_EXPORT2</a> <a name="l00227"></a>00227 <a class="code" href="ucsdet_8h.html#ab9433e14dbe7704a4cf9b2b2f1a7377b" title="Get the name of the charset represented by a UCharsetMatch.">ucsdet_getName</a>(<span class="keyword">const</span> <a class="code" href="ucsdet_8h.html#a4e40a6a6dae057f9257e144fc65ba667" title="Opaque structure representing a match that was identified from a charset detection...">UCharsetMatch</a> *ucsm, <a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c" title="Error code to replace exception handling, so that the code is compatible with all...">UErrorCode</a> *status); <a name="l00228"></a>00228 <a name="l00252"></a>00252 <a class="code" href="umachine_8h.html#af3e3799716eaa41e3f49c7bf18c62b98" title="This is used to declare a function as a stable public ICU C API.">U_STABLE</a> int32_t <a class="code" href="platform_8h.html#a72bf6d8ec0640a37b1915e5d853b2016">U_EXPORT2</a> <a name="l00253"></a>00253 <a class="code" href="ucsdet_8h.html#aa1dd7ce8c727d855697aac1f35df71ed" title="Get a confidence number for the quality of the match of the byte data with the charset...">ucsdet_getConfidence</a>(<span class="keyword">const</span> <a class="code" href="ucsdet_8h.html#a4e40a6a6dae057f9257e144fc65ba667" title="Opaque structure representing a match that was identified from a charset detection...">UCharsetMatch</a> *ucsm, <a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c" title="Error code to replace exception handling, so that the code is compatible with all...">UErrorCode</a> *status); <a name="l00254"></a>00254 <a name="l00284"></a>00284 <a class="code" href="umachine_8h.html#af3e3799716eaa41e3f49c7bf18c62b98" title="This is used to declare a function as a stable public ICU C API.">U_STABLE</a> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="platform_8h.html#a72bf6d8ec0640a37b1915e5d853b2016">U_EXPORT2</a> <a name="l00285"></a>00285 <a class="code" href="ucsdet_8h.html#a54b1e448b1d9cce1ac017962aaa801aa" title="Get the RFC 3066 code for the language of the input data.">ucsdet_getLanguage</a>(<span class="keyword">const</span> <a class="code" href="ucsdet_8h.html#a4e40a6a6dae057f9257e144fc65ba667" title="Opaque structure representing a match that was identified from a charset detection...">UCharsetMatch</a> *ucsm, <a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c" title="Error code to replace exception handling, so that the code is compatible with all...">UErrorCode</a> *status); <a name="l00286"></a>00286 <a name="l00287"></a>00287 <a name="l00310"></a>00310 <a class="code" href="umachine_8h.html#af3e3799716eaa41e3f49c7bf18c62b98" title="This is used to declare a function as a stable public ICU C API.">U_STABLE</a> int32_t <a class="code" href="platform_8h.html#a72bf6d8ec0640a37b1915e5d853b2016">U_EXPORT2</a> <a name="l00311"></a>00311 <a class="code" href="ucsdet_8h.html#a30fd9ddb4090bd730caa49c22a3880e1" title="Get the entire input text as a UChar string, placing it into a caller-supplied buffer...">ucsdet_getUChars</a>(<span class="keyword">const</span> <a class="code" href="ucsdet_8h.html#a4e40a6a6dae057f9257e144fc65ba667" title="Opaque structure representing a match that was identified from a charset detection...">UCharsetMatch</a> *ucsm, <a name="l00312"></a>00312 <a class="code" href="umachine_8h.html#a6bb9fad572d65b305324ef288165e2ac" title="Define UChar to be wchar_t if that is 16 bits wide; always assumed to be unsigned...">UChar</a> *buf, int32_t cap, <a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c" title="Error code to replace exception handling, so that the code is compatible with all...">UErrorCode</a> *status); <a name="l00313"></a>00313 <a name="l00314"></a>00314 <a name="l00315"></a>00315 <a name="l00335"></a>00335 <a class="code" href="umachine_8h.html#af3e3799716eaa41e3f49c7bf18c62b98" title="This is used to declare a function as a stable public ICU C API.">U_STABLE</a> <a class="code" href="uenum_8h.html#a32b7253b2148022535be36a9fcdb5a8d" title="structure representing an enumeration object instance">UEnumeration</a> * <a class="code" href="platform_8h.html#a72bf6d8ec0640a37b1915e5d853b2016">U_EXPORT2</a> <a name="l00336"></a>00336 <a class="code" href="ucsdet_8h.html#a60dcfd7a2b826b995c86becf2f802016" title="Get an iterator over the set of all detectable charsets - over the charsets that...">ucsdet_getAllDetectableCharsets</a>(<span class="keyword">const</span> <a class="code" href="ucsdet_8h.html#a8f341f9c43bf58b112afd70c8a94c45d" title="Structure representing a charset detector.">UCharsetDetector</a> *ucsd, <a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c" title="Error code to replace exception handling, so that the code is compatible with all...">UErrorCode</a> *status); <a name="l00337"></a>00337 <a name="l00338"></a>00338 <a name="l00349"></a>00349 <a class="code" href="umachine_8h.html#af3e3799716eaa41e3f49c7bf18c62b98" title="This is used to declare a function as a stable public ICU C API.">U_STABLE</a> <a class="code" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5" title="The ICU boolean type.">UBool</a> <a class="code" href="platform_8h.html#a72bf6d8ec0640a37b1915e5d853b2016">U_EXPORT2</a> <a name="l00350"></a>00350 <a class="code" href="ucsdet_8h.html#a04e3e10583476b1b53a677ebb5acfe67" title="Test whether input filtering is enabled for this charset detector.">ucsdet_isInputFilterEnabled</a>(<span class="keyword">const</span> <a class="code" href="ucsdet_8h.html#a8f341f9c43bf58b112afd70c8a94c45d" title="Structure representing a charset detector.">UCharsetDetector</a> *ucsd); <a name="l00351"></a>00351 <a name="l00352"></a>00352 <a name="l00364"></a>00364 <a class="code" href="umachine_8h.html#af3e3799716eaa41e3f49c7bf18c62b98" title="This is used to declare a function as a stable public ICU C API.">U_STABLE</a> <a class="code" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5" title="The ICU boolean type.">UBool</a> <a class="code" href="platform_8h.html#a72bf6d8ec0640a37b1915e5d853b2016">U_EXPORT2</a> <a name="l00365"></a>00365 <a class="code" href="ucsdet_8h.html#ad4911fca8b4685bba2c1b77ea2d2b535" title="Enable filtering of input text.">ucsdet_enableInputFilter</a>(<a class="code" href="ucsdet_8h.html#a8f341f9c43bf58b112afd70c8a94c45d" title="Structure representing a charset detector.">UCharsetDetector</a> *ucsd, <a class="code" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5" title="The ICU boolean type.">UBool</a> filter); <a name="l00366"></a>00366 <a name="l00367"></a>00367 <span class="preprocessor">#endif</span> <a name="l00368"></a>00368 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* __UCSDET_H */</span> <a name="l00369"></a>00369 <a name="l00370"></a>00370 </pre></div></div> <!--- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Defines</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <hr class="footer"/><address style="text-align: right;"><small>Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2-20100208 </small></address> </body> </html>