mlenc(n) 0.1 "mlenc"

NAME

mlenc - mlang.dll encoding

TABLE OF CONTENTS

    TABLE OF CONTENTS
    SYNOPSIS
    DESCRIPTION
    REQUIREMENTS
    COMMANDS
    SAMPLE
    REFERENCES
    SEE ALSO
    KEYWORDS
    COPYRIGHT

SYNOPSIS

package require Tcl 8.4
package require mlenc

mlenc::encoding ?options?
mlenc::encoding convert fromEncoding toEncoding data
mlenc::encoding convertto encoding data
mlenc::encoding convertfrom encoding data
mlenc::encoding names
mlenc::encoding aliasnames
mlenc::encoding aliasmaps

DESCRIPTION

mlenc is a extension for encoding conversion with mlang.dll. The mlang.dll is a part of InternetExplorer.

REQUIREMENTS

COMMANDS

mlenc::encoding ?options?
the mlenc::encoding is an ensemble command. It requires a subcommand.

mlenc::encoding convert fromEncoding toEncoding data
Convert specified encoding byte array to another encoding byte array. Encoding name can specify alias names or code page identifiers.

mlenc::encoding convertto encoding data
Convert tcl internal string object to specified encoding byte array. Encoding name can specify alias names or code page identifiers.

mlenc::encoding convertfrom encoding data
Convert byte array object to tcl internal string. Encoding name can specify alias names or code page identifiers.

mlenc::encoding names
Show a list of code page identifiers.

mlenc::encoding aliasnames
Show a list of alias names of code page identifiers. These alias names can be used instead of code page identifiers.

mlenc::encoding aliasmaps
Show a list of mapping of alias names and code page identifiers. This command is used for what alias name is mapped to a code page identifier.

SAMPLE

convert from x-euc-jp (cp51932)

 
mlenc::encoding convertfrom 51932 $str

convert from cp932 to utf-8 directry.

 
mlenc::encoding convert 932 utf-8 $str

The _autodetect encoding is able to automatically distinguish between shiftjis and euc-jp. But it requires a bit long string. And it can not recognize utf-8.

 
set a [mlenc::encoding convertfrom _autodetect [encoding convertto euc-jp $str]]
set b [mlenc::encoding convertfrom _autodetect [encoding convertto shiftjis $str]]

REFERENCES

  1. http://msdn2.microsoft.com/En-US/library/aa767865.aspx
  2. http://msdn2.microsoft.com/En-US/library/ms776446.aspx

SEE ALSO

encoding

KEYWORDS

encoding, mlang.dll, mlenc

COPYRIGHT

Copyright © 2007 OHTSUKA, Yoshio <ohtsuka.yoshio@gmail.com>