~ubuntu-branches/ubuntu/precise/open-vm-tools/precise

« back to all changes in this revision

Viewing changes to lib/unicode/unicodeSimpleTypes.c

  • Committer: Bazaar Package Importer
  • Author(s): Serge Hallyn
  • Date: 2011-03-31 14:20:05 UTC
  • mfrom: (1.4.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110331142005-3n9red91p7ogkweo
Tags: 2011.03.28-387002-0ubuntu1
* Merge latest upstream git tag.  This has the unlocked_ioctl change
  needed to fix dkms build failures (LP: #727342)
* Changes in debian/rules:
  - work around a bug in toolbox/Makefile, where install-exec-hook is
    not happening.  This needs to get fixed the right way.
  - don't install 'vmware-user' which seems to no longer exist
  - move /etc/xdg into open-vm-toolbox (which should be done using .install)
* debian/open-vm-tools.init: add 'modprobe [-r] vmblock'. (LP: #332323)
* debian/rules and debian/open-vm-toolbox.lintian-overrides:
  - Make vmware-user-suid-wrapper suid-root (LP: #332323)

Show diffs side-by-side

added added

removed removed

Lines of Context:
390
390
    * Source: RFC-1468 (see also RFC-2237)
391
391
    *         Windows-50221 and 50222 are routed here
392
392
    */
393
 
   { 39, 50220, STRING_ENCODING_ISO_2022_JP, IN_FULL_ICU, 0,
 
393
   { 39, 50220, STRING_ENCODING_ISO_2022_JP, SUPPORTED, 0,
394
394
      { "ISO-2022-JP", "csISO2022JP", NULL }
395
395
   },
396
396
   /*
2256
2256
    *              Japanese (JIS-Allow 1 byte Kana)
2257
2257
    *              handled by ICU with ISO-2022-JP
2258
2258
    */
2259
 
   { MIBUNDEF, 50221, STRING_ENCODING_WINDOWS_50221, IN_FULL_ICU, 0,
 
2259
   { MIBUNDEF, 50221, STRING_ENCODING_WINDOWS_50221, SUPPORTED, 0,
2260
2260
      { "csISO2022JP", NULL }
2261
2261
   },
2262
2262
   /*
2677
2677
/*
2678
2678
 *-----------------------------------------------------------------------------
2679
2679
 *
 
2680
 * Unicode_GetCurrentEncoding --
 
2681
 *
 
2682
 *      Return the current encoding (corresponding to
 
2683
 *      CodeSet_GetCurrentCodeSet()).
 
2684
 *
 
2685
 * Results:
 
2686
 *      The current encoding.
 
2687
 *
 
2688
 * Side effects:
 
2689
 *      Since the return value of CodeSet_GetCurrentCodeSet() and our
 
2690
 *      look-up table do not change, we memoize the value.
 
2691
 *
 
2692
 *-----------------------------------------------------------------------------
 
2693
 */
 
2694
 
 
2695
StringEncoding
 
2696
Unicode_GetCurrentEncoding(void)
 
2697
{
 
2698
   static StringEncoding encoding = STRING_ENCODING_UNKNOWN;
 
2699
 
 
2700
   if (UNLIKELY(encoding == STRING_ENCODING_UNKNOWN)) {
 
2701
      encoding = UnicodeGetCurrentEncodingInternal();
 
2702
   }
 
2703
 
 
2704
   return encoding;
 
2705
}
 
2706
 
 
2707
 
 
2708
/*
 
2709
 *-----------------------------------------------------------------------------
 
2710
 *
 
2711
 * Unicode_ResolveEncoding --
 
2712
 *
 
2713
 *      Resolves a meta-encoding enum value (e.g. STRING_ENCODING_DEFAULT) to
 
2714
 *      a concrete one (e.g. STRING_ENCODING_UTF8).
 
2715
 *
 
2716
 * Results:
 
2717
 *      A StringEncoding enum value.  May return STRING_ENCODING_UNKNOWN.
 
2718
 *
 
2719
 * Side effects:
 
2720
 *      None
 
2721
 *
 
2722
 *-----------------------------------------------------------------------------
 
2723
 */
 
2724
 
 
2725
StringEncoding
 
2726
Unicode_ResolveEncoding(StringEncoding encoding)  // IN:
 
2727
{
 
2728
   if (encoding == STRING_ENCODING_DEFAULT) {
 
2729
      encoding = Unicode_GetCurrentEncoding();
 
2730
   }
 
2731
 
 
2732
   ASSERT(Unicode_IsEncodingValid(encoding));
 
2733
 
 
2734
   return encoding;
 
2735
}
 
2736
 
 
2737
 
 
2738
/*
 
2739
 *-----------------------------------------------------------------------------
 
2740
 *
2680
2741
 * Unicode_IsEncodingValid --
2681
2742
 *
2682
2743
 *      Checks whether we support the given encoding.
2862
2923
   UnicodeInitInternal(argc, NULL, NULL, NULL, argv, envp);
2863
2924
}
2864
2925
 
2865
 
 
2866
2926
#ifdef TEST_CUSTOM_ICU_DATA_FILE
2867
2927
/*
2868
2928
 *-----------------------------------------------------------------------------
2880
2940
 *      To test custom ICU files, change the second arg in the call to
2881
2941
 *      UnicodeInitInternal() above to the *directory* containing the ICU
2882
2942
 *      data file, and add a call to this function.  Note that the name of
2883
 
 *      the data file is hard coded to "icudt38l.dat" in lib/misc/codeset.c.
 
2943
 *      the data file is hard coded to "icudt44l.dat" in lib/misc/codeset.c.
2884
2944
 *      Also note that in devel builds, lib/misc/codeset.c will override the 
2885
2945
 *      icu directory argument with a path to the toolchain, so that may need 
2886
2946
 *      to be disabled, too.