Logo Search packages:      
Sourcecode: icu version File versions  Download package

U_STABLE char* U_EXPORT2 u_austrcpy ( char *  dst,
const UChar *  src 
)

Copy ustring to a byte string encoded in the default codepage. Adds a null terminator. Performs a UChar to host byte conversion

Parameters:
dst The destination string.
src The source string.
Returns:
A pointer to dst. ICU 2.0

Definition at line 210 of file ustr_cnv.c.

References NULL, U_SUCCESS, and U_ZERO_ERROR.

{
  UErrorCode err = U_ZERO_ERROR;
  UConverter *cnv = u_getDefaultConverter(&err);
  if(U_SUCCESS(err) && cnv != NULL) {
    int32_t len = ucnv_fromUChars(cnv,
                  s1,
                  MAX_STRLEN,
                  ucs2,
                  -1,
                  &err);
    u_releaseDefaultConverter(cnv);
    s1[len] = 0;
  } else {
    *s1 = 0;
  }
  return s1;
}


Generated by  Doxygen 1.6.0   Back to index