Proud::CStringEncoder Class Reference

Public Member Functions

CPnIconv * GetIconv ()
 
void ReleaseIconv (CPnIconv *obj)
 

Static Public Member Functions

static PROUD_API CStringEncoderCreate (const char *srcCodepage, const char *destCodepage)
 

Detailed Description

It is a wrapper class.

  • After creating by “create”, you can use GetIconv-ReleaseIconv as the local variable whenever needed.
  • iconv objective is provided as the form of object pooling for concurrent access to many threads. As a result of this, it is fast.

ProudNet used win32 function in the past but for unifying multi-platform, it uses this in Windows for string processing.

Example code:

StringA2W(a, b); // use platform-specific default encoder
// use the encoder you select
shared_ptr<CStringEncoder> e(CStringEncoder::Create("UTF-8", "UTF-16LE"));
StringA2W(a, b, e);