---
name: "SHUnicodeToAnsiCP"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/SHUnicodeToAnsiCP"
---

# SHUnicodeToAnsiCP(3w)

## NAME

**SHUnicodeToAnsiCP** (SHLWAPI.218)

## SYNOPSIS

DWORD SHUnicodeToAnsiCP\
  (\
   UINT    *CodePage*,\
   LPCWSTR *lpSrcStr*,\
   LPSTR   *lpDstStr*,\
   int     *dstlen*\
  )

## DESCRIPTION

Convert a Unicode string to Ascii.

## PARAMS

*CodePage* **\[In\]**  Code page to use for the conversion.

*lpSrcStr* **\[In\]**  Source Unicode string to convert.

*lpDstStr* **\[Out\]**  Destination for converted Ascii string.

*dstlen* **\[In\]**  Length of buffer at *lpDstStr*.

## RETURNS

**Success:** The length in bytes of the result at *lpDstStr* (including the terminator)

**Failure:** When using **CP\_UTF8**, **CP\_UTF7** or 0xc350 as codePage, **0** is returned and the result is not nul-terminated. When using a different codepage, the length in bytes of the truncated result at *lpDstStr* (including the terminator) is returned and *lpDstStr* is always nul-terminated.

## IMPLEMENTATION

Exported by ordinal only. Use **[GetProcAddress(3w)](/GetProcAddress/3w.md)** to obtain a pointer to the function.

Implemented in **"dlls/shlwapi/string.c"**.

Debug channel **"shell"**.
