~n-muench/ubuntu/oneiric/open-vm-tools/open-vm-tools.fix-836277

« back to all changes in this revision

Viewing changes to lib/unicode/unicodeSimpleBase.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2008-10-23 15:32:00 UTC
  • mfrom: (1.1.2 upstream) (2.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20081023153200-gc1bfx89hj35c799
Tags: 2008.10.10-123053-2
* Correcting typo in dh_installinit call.
* Downgrading depends on module-assistant to recommends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
141
141
 *      Otherwise, buffer must be of the specified length, but does
142
142
 *      not need to be NUL-terminated.
143
143
 *
 
144
 *      This function should not be used for heuristic determination of
 
145
 *      encodings.  Since the test looks for bit patterns in the buffer
 
146
 *      that are invalid in the specified encoding, negative results
 
147
 *      guarantee the buffer is not in the specified encoding, but positive
 
148
 *      results are inconclusive.  Source buffers containing pure ASCII
 
149
 *      will pass all 8-bit encodings, and all source buffers will pass 
 
150
 *      a windows-1252 test since win-1252 maps all 256 8-bit combinations.
 
151
 *
144
152
 * Results:
145
153
 *      TRUE if the buffer is valid, FALSE if it's not.
146
154
 *
458
466
 
459
467
   switch (encoding) {
460
468
   case STRING_ENCODING_UTF8:
461
 
      return strlen(utf8) + 1;
 
469
      return strlen((const char *)utf8) + 1;
462
470
   case STRING_ENCODING_US_ASCII:
463
471
   case STRING_ENCODING_ISO_8859_1:
464
472
   case STRING_ENCODING_WINDOWS_1252: