summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-01-23 17:17:10 +0100
committerBram Moolenaar <Bram@vim.org>2013-01-23 17:17:10 +0100
commitd35d784e9106a9d398b444ed9557664bbcb6a65c (patch)
treef355a77e327600d011c042159609fa9fab9e2d03 /runtime
parent55b7b7eeb50d4fab541ba151e0f653eb6e3852b8 (diff)
updated for version 7.3.780v7.3.780
Problem: char2nr() and nr2char() always use 'encoding'. Solution: Add argument to use utf-8 characters. (Yasuhiro Matsumoto)
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/eval.txt20
1 files changed, 12 insertions, 8 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 6057d61a38..7594ea9805 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1716,7 +1716,7 @@ call( {func}, {arglist} [, {dict}])
any call {func} with arguments {arglist}
ceil( {expr}) Float round {expr} up
changenr() Number current change number
-char2nr( {expr}) Number ASCII value of first char in {expr}
+char2nr( {expr}[, {utf8}]) Number ASCII/UTF8 value of first char in {expr}
cindent( {lnum}) Number C indent for line {lnum}
clearmatches() none clear all matches
col( {expr}) Number column nr of cursor or mark
@@ -1873,7 +1873,7 @@ mkdir( {name} [, {path} [, {prot}]])
mode( [expr]) String current editing mode
mzeval( {expr}) any evaluate |MzScheme| expression
nextnonblank( {lnum}) Number line nr of non-blank line >= {lnum}
-nr2char( {expr}) String single char with ASCII value {expr}
+nr2char( {expr}[, {utf8}]) String single char with ASCII/UTF8 value {expr}
or( {expr}, {expr}) Number bitwise OR
pathshorten( {expr}) String shorten directory names in a path
pow( {x}, {y}) Float {x} to the power of {y}
@@ -2294,14 +2294,16 @@ changenr() *changenr()*
redo it is the number of the redone change. After undo it is
one less than the number of the undone change.
-char2nr({expr}) *char2nr()*
+char2nr({expr}[, {utf8}]) *char2nr()*
Return number value of the first char in {expr}. Examples: >
char2nr(" ") returns 32
char2nr("ABC") returns 65
-< The current 'encoding' is used. Example for "utf-8": >
+< When {utf8} is omitted or zero, the current 'encoding' is used.
+ Example for "utf-8": >
char2nr("á") returns 225
char2nr("á"[0]) returns 195
-< A combining character is a separate character.
+< With {utf8} set to 1, always treat as utf-8 characters.
+ A combining character is a separate character.
|nr2char()| does the opposite.
cindent({lnum}) *cindent()*
@@ -4371,14 +4373,16 @@ nextnonblank({lnum}) *nextnonblank()*
below it, zero is returned.
See also |prevnonblank()|.
-nr2char({expr}) *nr2char()*
+nr2char({expr}[, {utf8}]) *nr2char()*
Return a string with a single character, which has the number
value {expr}. Examples: >
nr2char(64) returns "@"
nr2char(32) returns " "
-< The current 'encoding' is used. Example for "utf-8": >
+< When {utf8} is omitted or zero, the current 'encoding' is used.
+ Example for "utf-8": >
nr2char(300) returns I with bow character
-< Note that a NUL character in the file is specified with
+< With {utf8} set to 1, always return utf-8 characters.
+ Note that a NUL character in the file is specified with
nr2char(10), because NULs are represented with newline
characters. nr2char(0) is a real NUL and terminates the
string, thus results in an empty string.