Index
All Packages
All Categories
By Author

ap (3)
cp (3)
dp (3)
exe (3)
gui (0)
gui/gtk (0)
gui/tk (4)
io (1)
lib (11)
math (0)
net (9)
nlp (18)
op (4)
os (2)
program (3)
sp (2)
tool (9)
wp (2)
xml (2)

Unicode

type:package
id:mogul:/fkonvick/unicode
section:mogul:/fkonvick
version:1.0
blurb:Unicode Support
author:Filip Konvicka
category:ap, gui/tk, lib, os, sp
download:fkonvick-unicode__1.3.0__source__1.0.pkg
provides:x-ozlib://fkonvick/unicode/unicode.ozf
Unicode Support

This package contains the following conversion functions:
1. utf8_to_Unicode: UTF-8 (a String) --> Unicode (a List of integers)
2. encode: Unicode --> String (in a user-chosen encoding, including utf-8, cp852, cp1250 etc.); non-representable characters are replaced with "?"
3. getCP: retrieves the console codepage. On Windows, this does "chcp /c"; on other platforms, it returns 'id', which is a non-existent encoding, so all special characters are shown as "?".
The encodings are compiled into the library, and are generated from the encoding files (*.enc) that come with ActiveTCL (see LICENSE.txt for licensing details). Note that not all encodings are supported, just the simple ones.

Examples:
{System.showInfo {Unicode.encode cp1250 {Unicode.utf8_to_Unicode "Hello world"}}