mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-08 06:53:45 +00:00
ICU-2134 The method for reenabling deprecated API is mostly wrong.
This information should be moved to the User's Guide. X-SVN-Rev: 10500
This commit is contained in:
parent
239da7c29b
commit
1afe1282f3
1 changed files with 1 additions and 52 deletions
|
@ -69,8 +69,7 @@
|
|||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#MakeICUSmaller">
|
||||
How to Make ICU Smaller</a>
|
||||
<a href="#MakeICUSmaller">How to Make ICU Smaller</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
@ -89,9 +88,6 @@
|
|||
|
||||
<li><a href="#ImportantNotesDefaultCP">Using the Default
|
||||
Codepage</a></li>
|
||||
|
||||
<li><a href="#ImportantNotesDeprecatedAPI">Methods For Enabling
|
||||
Deprecated APIs</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
@ -1471,53 +1467,6 @@ ADDENVVAR ENVVAR(OUTPUTDIR) VALUE('<i>libraryname</i>')</samp>
|
|||
the converter was not packaged with ICU. The feature allows ICU to run in
|
||||
unusual computing environments without completely failing.</p>
|
||||
|
||||
<h3><a name="ImportantNotesDeprecatedAPI" href=
|
||||
"#ImportantNotesDeprecatedAPI">Methods for enabling deprecated
|
||||
APIs</a></h3>
|
||||
|
||||
<h4>C</h4>
|
||||
|
||||
<p>Some deprecated C APIs can be enabled without recompiling the ICU
|
||||
libraries. This can be achieved by defining certain symbols before
|
||||
including the ICU header files. For example, to enable deprecated C APIs
|
||||
for formatting.</p>
|
||||
<pre>
|
||||
<samp>#ifndef U_USE_DEPRECATED_FORMAT_API
|
||||
# define U_USE_DEPRECATED_FORMAT_API 1
|
||||
#endif
|
||||
|
||||
#include "unicode/udat.h"
|
||||
|
||||
int main(){
|
||||
UDateFormat *def, *fr, *fr_pat ;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
UChar temp[30];
|
||||
|
||||
fr = udat_open(UDAT_FULL, UDAT_DEFAULT, "fr_FR", NULL,0, &status);
|
||||
if(U_FAILURE(status)){
|
||||
printf("Error creating the french dateformat using full time style\n %s\n",
|
||||
myErrorName(status) );
|
||||
}
|
||||
/* This is supposed to open default date format,
|
||||
but later on it treats it like it is "en_US".
|
||||
This is very bad when you try to run the tests
|
||||
on a machine where the default locale is NOT "en_US"
|
||||
*/
|
||||
def = udat_open(UDAT_SHORT, UDAT_SHORT, "en_US", NULL, 0, &status);
|
||||
if(U_FAILURE(status)){
|
||||
.... /* handle the error */
|
||||
}
|
||||
}</samp>
|
||||
</pre>
|
||||
|
||||
<h4>C++</h4>
|
||||
|
||||
<p>Deprecated C++ APIs cannot be enabled without recompiling ICU libraries.
|
||||
Every service has a specific symbol that should be defined to enable the
|
||||
deprecated API of that service. For example: To enable deprecated APIs in
|
||||
transliteration service, the U_USE_DEPRECATED_TRANSLITERATOR_API symbol
|
||||
should be defined before compiling ICU.</p>
|
||||
|
||||
<h2><a name="PlatformDependencies" href="#PlatformDependencies">Platform
|
||||
Dependencies</a></h2>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue