Share via


MLang

This section covers the functionality provided by MLang, which is intended to help developers solve problems presented by the international scope of the Internet. These tools allow a developer to deal with a variety of international and multilingual issues. MLang provides:

  • Code page and locale enumeration from the MIME database.
  • Code page, locale, and character set information retrieval.
  • Character set conversion between different multibyte character sets, as well as to and from Unicode.
  • A method of working with a set of code pages at once.
  • A way to determine which code pages contain a given character or string.
  • Detection of which possible code pages and languages text data is written in.
  • Custom font creation to display characters from a variety of character sets at once.
  • Locale-aware line breaking for console-based applications.

The following sections describe the services that are exported by the Mlang.dll dynamic-link library.

Overviews/Tutorials

Topic Contents
How to Break Text Based on Locale

Different languages might have different rules for hyphenation, spacing, and where a line should be broken on a page. For this reason, the MLang IMLangLineBreakConsole interface provides a locale-aware line-breaking functionality for console-based applications.

How to Enumerate Code Pages and Locales

MLang provides two enumeration objects that can be used to retrieve the code pages and locales that are recognized by the system from the MIME database.

How to Use Font Linking

MLang implements a service called font linking to assist developers who must output strings that contain characters from a variety of character sets. This service creates a custom font that inherits from a specified source font. The IMLangFontLink interface contains the methods a client uses to perform font linking.

Introduction to MLang

MLang implements a set of services that is designed to help make software that interacts with Internet data more international. More specifically, MLang helps solve problems presented by the multilingual environment that exists for software today. This article describes the services that are provided by the MLang Component Object Model (COM) object.

MLang Functions

This section lists the MLANG exported functions. When an application uses these functions, it must have the source code page and the destination code page to pass as parameters.

 

Objects

Topic Contents
Code Page Enumeration

Retrieves a list of all the code pages the system recognizes.

Conversion

A conversion engine dedicated to a specified combination of source and destination code pages.

Locale Enumeration

Retrieves a sequence of RFC1766INFO structures.

MultiLanguage

Provides access to all other objects and interfaces implemented by MLang. The MultiLanguage object is the primary MLang object.

Script Enumeration

Retrieves a list of all the scripts on the system.

 

Interfaces

Topic Contents
IEnumCodePage

Gets information about many code pages at one time or determines which code pages fit a certain flag.

IEnumRfc1766

Creates a list of all locale identifiers (LCIDs) in the MIME database.

IEnumScript

Enumerates the scripts on the system.

IMLangCodePages

Provides the foundation of the IMLangFontLink interface and implements methods for working with code pages.

IMLangConvertCharset

Converts a string from one code page to another.

IMLangFontLink

Implements a set of services that allow an application to use font linking.

IMLangFontLink2

Implements a set of services that allow an application to use font linking.

IMLangLineBreakConsole

Provides a console-based, line-breaking service.

IMLangString

Not implemented.

IMLangStringAStr

Not implemented.

IMLangStringBuf

Not implemented.

IMLangStringNotifySink

Not implemented.

IMLangStringWStr

Not implemented.

IMLStrAttr

Not implemented.

IMLStrAttrAStr

Not implemented.

IMLStrAttrLocale

Not implemented.

IMLStrAttrLong

Not implemented.

IMLStrAttrNotifySink

Not implemented.

IMLStrAttrWStr

Not implemented.

IMultiLanguage

Collects information about character sets, code pages, or locales from the MIME database; and converts strings from one character set to another.

IMultiLanguage2

Collects information about character sets, code pages, or locales from the MIME database; and converts strings from one character set to another.

IMultiLanguage3

Extends the IMultiLanguage2 interface by adding outbound text detection functionality to it.

 

Functions

Topic Contents
ConvertINetMultiByteToUnicode

Translates a source string to a Unicode string and returns the result to a buffer.

ConvertINetString

Performs character set conversion between a given source code page identifier and a destination code page identifier.

ConvertINetUnicodeToMultiByte

Translates a character stream in Unicode to the specified destination code page.

IsConvertINetStringAvailable

Verifies that the specified character set conversion can be performed.

LcidToRfc1766

Translates a Windows locale identifier (LCID) to a human-readable name that conforms to RFC-1766.

Rfc1766ToLcid

Translates a conforming RFC-1766 name to a locale identifier (LCID) value.

 

Structures

Topic Contents
DetectEncodingInfo

Contains the results of code page detection by the IMultiLanguage2::DetectCodepageInIStream and IMultiLanguage2::DetectInputCodepage methods.

MIMECPINFO

Contains detailed information gathered from the MIME database about a given code page.

MIMECSETINFO

Contains information about a given charset.

RFC1766INFO

Contains information about a given locale identifier value (LCID), including the corresponding RFC1766-conforming name.

SCRIPTFONTINFO

Contains the information about the specified script.

SCRIPTINFO

Contains the information about the specified script.

UNICODERANGE

Contains the Unicode range supported by a particular font.

 

Enumerations

Topic Contents
MIMECONTF

Used as a member of the MIMECPINFO structure to specify the possible uses of a code page.

MLCONVCHAR

Used as an inbound or outbound flag for character set conversion.

MLCP

Used with the IMultiLanguage3::DetectOutboundCodePage and IMultiLanguage3::DetectOutboundCodePageInIStream to control the behavior of the methods.

MLDETECTCP

Used with the code page detection methods IMultiLanguage2::DetectInputCodepage and IMultiLanguage2::DetectCodepageInIStream to specify the type of the incoming data.

SCRIPTCONTF

Contains the script identifiers.

SCRIPTFONTCONTF

Contains the script font values.