Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
1.1 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. fntutil2.c
  5. Abstract:
  6. Convert NT4.0 RLE to GLYPHSETDATA.
  7. Convert NT4.0 IFI to UFM
  8. Environment:
  9. Win32 subsystem, Unidrv driver
  10. Revision History:
  11. 11-11-97 -eigos-
  12. Created it
  13. dd-mm-yy -author-
  14. description
  15. --*/
  16. #include "precomp.h"
  17. extern UINT guiCharsets[];
  18. extern UINT guiCodePages[];
  19. //
  20. // Internal macros
  21. //
  22. #ifndef CP_ACP
  23. #define CP_ACP 0
  24. #endif//CP_ACP
  25. #ifndef CP_OEMCP
  26. #define CP_OEMCP 1
  27. #endif//CP_OEMCP
  28. //
  29. // The number of charset table which is defiend in globals.c
  30. //
  31. #define NCHARSETS 14
  32. ULONG
  33. UlCharsetToCodePage(
  34. IN UINT uiCharSet)
  35. {
  36. INT iI;
  37. if (uiCharSet == OEM_CHARSET)
  38. {
  39. return CP_OEMCP;
  40. }
  41. else if (uiCharSet == SYMBOL_CHARSET)
  42. {
  43. return CP_ACP;
  44. }
  45. else
  46. {
  47. for (iI = 0; iI < NCHARSETS; iI ++)
  48. {
  49. if (guiCharsets[iI] == uiCharSet)
  50. {
  51. return guiCodePages[iI];
  52. }
  53. }
  54. return CP_ACP;
  55. }
  56. }