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.

77 lines
1.6 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1998, Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // iasutf8.h
  8. //
  9. // SYNOPSIS
  10. //
  11. // Declares functions for converting between UTF-8 and Unicode.
  12. //
  13. // MODIFICATION HISTORY
  14. //
  15. // 01/22/1999 Original version.
  16. //
  17. ///////////////////////////////////////////////////////////////////////////////
  18. #ifndef _IASUTF8_H_
  19. #define _IASUTF8_H_
  20. #if _MSC_VER >= 1000
  21. #pragma once
  22. #endif
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. //////////
  27. // Returns the number of characters required to hold the converted string. The
  28. // source string may not contain nulls. Returns -1 if 'src' is not a valid
  29. // UTF-8 string.
  30. //////////
  31. LONG
  32. WINAPI
  33. IASUtf8ToUnicodeLength(
  34. PCSTR src,
  35. DWORD srclen
  36. );
  37. //////////
  38. // Returns the number of characters required to hold the converted string.
  39. //////////
  40. LONG
  41. WINAPI
  42. IASUnicodeToUtf8Length(
  43. PCWSTR src,
  44. DWORD srclen
  45. );
  46. /////////
  47. // Converts a UTF-8 string to Unicode. Returns the number of characters in the
  48. // converted string. The source string may not contain nulls. Returns -1 if
  49. // 'src' is not a valid UTF-8 string.
  50. /////////
  51. LONG
  52. IASUtf8ToUnicode(
  53. PCSTR src,
  54. DWORD srclen,
  55. PWSTR dst
  56. );
  57. /////////
  58. // Converts a Unicode string to UTF-8. Returns the number of characters in the
  59. // converted string.
  60. /////////
  61. LONG
  62. IASUnicodeToUtf8(
  63. PCWSTR src,
  64. DWORD srclen,
  65. PSTR dst
  66. );
  67. #ifdef __cplusplus
  68. }
  69. #endif // __cplusplus
  70. #endif // _IASUTF8_H_