Classes that support conversions between Unicode/utf8/ansi

Source: Internet
Author: User

Zutf8_16.h file:

//---------------------------------------------------------------------------
#ifndef zutf8_16h
#define ZUTF8_16H
//---------------------------------------------------------------------------
/*
Classes that support the conversion between Unicode,unicode be, Utf8,ascii.
Date: 2007-06-15
Version: 1.0
Author: Little Elephant
Website: http://www.9ele.com
E-mail: zxjrainbow@9ele.com//Do not send spam to me ~ ~
Description: You can use this file at will, but if you modify the bug,
or modify it better, please let me know,
Let me also enjoy the benefits of open source, thank you.
*/
Enum Encodingtype
{
Uni8bit = 0,//default ASCII
Uni16be = 1,
Uni16le = 2,//Windows default encoding, which is Unicode
UniUTF8 = 3,
Uniutf8nobom = 4//UTF8 file with no UTF8 identifier header
};
Class Zutf8_16
{
Private
Encodingtype M_unicodemode; Encoding method
int isutf8_16 (const char *s, unsigned int len, unsigned *cchunused);
Encodingtype __fastcall determineencoding (unsigned char *data, size_t Ilen);
Public
__fastcall zutf8_16 ();
__fastcall ~zutf8_16 ();
Encodingtype __fastcall getencodingtype (void) {return m_unicodemode;};
BOOL __fastcall Loadfromstream (Tmemorystream *pstream, ansistring &desttext);
BOOL __fastcall streamsavetofile (Tmemorystream *pstream,
Ansistring Filenamea, Encodingtype unicodemode);
};
#endif

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.