vipsi - the friendly vip script interpreter

Instructions

convert

Text functions: convert
Instructions: convert
convert
<text_var> from|to <encoding>

Text functions: convert
Instructions: convert
Convert
Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
from Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
to named encoding.

Flow control: if … then
Flow control: try … then
The
Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
Glossary: Variable, var_refvariable is overwritten with Flow control: if … then
Flow control: try … then
the
result of Flow control: if … then
Flow control: try … then
the
conversion.
Flow control: if … then
Flow control: try … then
The
<encoding> must be a Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
, Operators: Bitwise Not "~"
Operators: Boolean Negation "!"
not
a Glossary: text, text_valtext value. List functions: thisThis means: just Instructions: writewrite Flow control: if … then
Flow control: try … then
the
nickname here.

e.g.:

Text functions: convert
Instructions: convert
convert
mytext to printable; Text functions: convert
Instructions: convert
convert
mytext to mac_roman; Text functions: convert
Instructions: convert
convert
mytext from html; Instructions: putput "http://", Text functions: convert
Instructions: convert
convert
(mytext to url)

Flow control: if … thenIf you need calculated encodings, you may use Vipsi command syntax: Operators
Operators
Glossary: Operator
operator
@ to Text functions: convert
Instructions: convert
convert
a Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
to a Vipsi command syntax: Identifiers (names)
Identifiers, names
Operators: Make Identifier "@"
Text functions: name
Glossary: Name, Identifier
name
:

Instructions: var
How does VScript::Value() work?: Var*&
var
myEncoding = "Constants: tabtab" # myTabWidth Text functions: convert
Instructions: convert
convert
myText to @(myEncoding);
Text conversions:
Character set conversions:
Important note on conversion to|from other character sets:

Take care that you Flow control: do … loopdo no double conversion!

Converting to a certain character set Text functions: convert
Instructions: convert
converts
Flow control: if … then
Flow control: try … then
the
Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
to Integer numbers: Binary
Floating point: Binary
Text functions: binstr
binary
data with all characters being bytes in range [0 .. 255], suitable for writing to Text functions: file
Instructions: file
file
Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
stream in Integer numbers: Binary
Floating point: Binary
Text functions: binstr
binary
mode.

Converting from a certain character set expects Flow control: if … then
Flow control: try … then
the
Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
to be Integer numbers: Binary
Floating point: Binary
Text functions: binstr
binary
data with all characters being bytes in range [0 .. 255], as Instructions: readread in Integer numbers: Binary
Floating point: Binary
Text functions: binstr
binary
mode from a Text functions: file
Instructions: file
file
Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
stream.

Converting a Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
to a certain character set an Flow control: if … then
Flow control: try … then
then
writing it with Instructions: putput to a Text functions: file
Instructions: file
file
Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
stream, is certainly an error, because Instructions: putput most likely also performs a convert: Character set conversions:
convert: Character set conversions:
character set conversion
, by default to UTF-8. After having converted a character set by hand you must Instructions: writewrite Flow control: if … then
Flow control: try … then
the
data in Integer numbers: Binary
Floating point: Binary
Text functions: binstr
binary
mode, without any further conversion, e.g. with Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
Instructions: writewrite Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
using Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
Text functions: file
Instructions: file
file
.

Flow control: if … then
Flow control: try … then
The
same is true for reading with Instructions: getget Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
converting Flow control: if … then
Flow control: try … then
the
Instructions: readread Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
from a certain character set, because Instructions: getget has most likely already performed a convert: Character set conversions:
convert: Character set conversions:
character set conversion
, by default from UTF-8. Flow control: if … thenIf you want to Text functions: convert
Instructions: convert
convert
Flow control: if … then
Flow control: try … then
the
data by hand you must Instructions: readread it in Integer numbers: Binary
Floating point: Binary
Text functions: binstr
binary
mode, e.g. with Vipsi command syntax: Instructions
Instructions
Glossary: Instruction
instruction
Instructions: readread Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
Vipsi command syntax: Functions
Functions
Glossary: Function
function
Text functions: file
Instructions: file
file
.

e.g. UCS-4:

Converting Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
to UCS-4 expands each character to 4 characters, each representable in 1 byte, suitable for writing in Integer numbers: Binary
Floating point: Binary
Text functions: binstr
binary
mode to a Text functions: file
Instructions: file
file
e.g. with Instructions: writewrite.

Converting Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
from UCS-4 combines every 4 characters into one character, assuming that Flow control: if … then
Flow control: try … then
the
source Data Types: Text
Item selector "[]": Text
Glossary: text, text_val
text
only contains bytes e.g. Instructions: readread in Integer numbers: Binary
Floating point: Binary
Text functions: binstr
binary
mode with Instructions: readread.

Instructions: var
How does VScript::Value() work?: Var*&
var
a = Text functions: file
Instructions: file
file
"filename"
Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
Text functions: file
Instructions: file
file
"filename" = a
also Instructions: readread/Instructions: writewrite Integer numbers: Binary
Floating point: Binary
Text functions: binstr
binary
data Operators: Boolean And with Variable "&&="
Operators: Bitwise And with Variable "&="
Operators: Bitwise And "&"
Operators: Boolean And "&&"
and
are suitable targets for a by-hand conversion.

Instructions: getget Operators: Boolean Or with Variable "||="
Operators: Bitwise Or with Variable "|="
Operators: Bitwise Or "|"
Operators: Boolean Or "||"
or
Instructions: putput already perform a conversion from|to UTF-8 (may be changed with Functions with varying return types: ioctl
Instructions: ioctl
ioctl
- Operators: Bitwise Not "~"
Operators: Boolean Negation "!"
not
yet implemented in version 0.8.7). Applying a conversion after reading with Instructions: getget / before writing with Instructions: putput without having disabled any conversion is certainly an error.

Valid HTML   Valid CSS