---++!! !commonlib.Encoding %TOC{title="Contents:"}% %STARTINCLUDE% ---++ encoding functions | *Title* | encoding functions | | *Author(s)* | LiXizhi | | *Date* | 2008/12/10 | | *File* | script/ide/Encoding.lua | ---+++ Description file encoding is a very complicated issue. if the npl file encoding is set to utf8 ( usually without signature), then to display a file, one usually needs to convert from system default encoding to utf8 and vice versa. However, it is still impossible to display a file name created in one encoding system and opened in another. %T% __Sample Code__ <verbatim> NPL.load("(gl)script/ide/Encoding.lua"); commonlib.Encoding.Utf8ToDefault(text) commonlib.Encoding.DefaultToUtf8(text) print(commonlib.Encoding.SortCSVString("Cword,Aword,Bword")) </verbatim> ---+++ Member Functions ---++++ !commonlib.Encoding.SortCSVString sort commar separated vector (CSV) string alphabetically * _param_ __fields__ : string such as "C,B,A", or a table containing string arrays such as {"C", "B", "A"} * _return_ __return__ : a new CSV string "A,B,C" __syntax__ <verbatim>function commonlib.Encoding.SortCSVString(fields)</verbatim> __parameters__ | *fields* | string such as "C,B,A", or a table containing string arrays such as {"C", "B", "A"} | %STOPINCLUDE%
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r1 - 2008-02-29
-
LiXizhi
Home
Site map
CCWeb web
HaqiTeen web
Main web
ParaEngine web
TWiki web
Main Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
导航页WebTopMenu
Preferences
开发指南
Getting Started
ParacraftSDK
NPL
MCML
NPL Reference Manual
美术Mod
Account
Log In
English
简体中文
簡體中文
E
dit
A
ttach
Copyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback