You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Windows Sockets: Converting Strings | Microsoft Docs
ms.custom
ms.date
11/04/2016
ms.reviewer
ms.suite
ms.technology
cpp-windows
ms.tgt_pltfrm
ms.topic
article
dev_langs
C++
helpviewer_keywords
Windows Sockets [C++], multibyte character string conversion
sockets [C++], multibyte character string conversion issues
string conversion, multibyte character strings
ms.assetid
9df522b5-6b23-41e0-bb96-e4e623baf141
caps.latest.revision
11
author
mikeblome
ms.author
mblome
manager
ghogen
translation.priority.ht
cs-cz
de-de
es-es
fr-fr
it-it
ja-jp
ko-kr
pl-pl
pt-br
ru-ru
tr-tr
zh-cn
zh-tw
Windows Sockets: Converting Strings
This article and two companion articles explain several issues in Windows Sockets programming. This article covers converting strings. The other issues are covered in Windows Sockets: Blocking and Windows Sockets: Byte Ordering.
If you use or derive from class CAsyncSocket, you will need to manage these issues yourself. If you use or derive from class CSocket, MFC manages them for you.
Converting Strings
If you communicate between applications that use strings stored in different wide-character formats, such as Unicode or multibyte character sets (MBCS), or between one of these and an application using ANSI character strings, you must manage the conversions yourself under CAsyncSocket. The CArchive object used with a CSocket object manages this conversion for you through the capabilities of class CString. For more information, see the Windows Sockets specification, located in the Windows SDK.