unicode - unicode characters
The Unicode function returns all types of character for multiple languages (also UTF-8).
Unicode contains special languages and graphical characters not commonly used in standard Latin texts.
Unicode characters are perfect to test input fields in your application and verify how texts are stored in the database. If you want to upset your DBA use the pattern below to generate random characters from the "Unified Canadian Aboriginal Syllabics" unicode range :)
unicode(60,24) - will generate 60 characters from range 24 (Unified Canadian Aboriginal Syllabics)
If you want to copy & paste these characters to another program, make sure the target application is UTF-8 encoded.
Unicode / UTF-8 ranges & references:
Usage(s)
unicode () |
Returns a printable unicode character from any of the predefined ranges. |
unicode ( $length ) |
Returns a string of Unicode characters with a length of $length. |
unicode ( $length , $rangeMin, $rangeMax ) |
Returns a string of unicode character with length $length in the unicode range $rangeMin to $rangeMax |
unicode ( $length , $range ) |
Returns a string of unicode character with length $length in the unicode range $range |
Parameter(s)
$length |
The length of the string to generate |
$rangeMin |
The minimum (decimal) range for the unicode character (Unicode Table) |
$rangeMax |
The maximum (decimal) range for the unicode character (Unicode Table) |
$range |
The predefined range that the generator engine uses to pick characters from.
These are the supported pre-defined ranges:
# | Range |
0 | Latin |
1 | Latin-1 Supplement |
2 | Latin-Extended A |
3 | Latin-Extended B |
4 | IPA Extentions |
5 | Greek and Coptic |
6 | Cyrillic |
7 | Cyrillic Supplementary |
8 | Armenian |
9 | Hebrew |
10 | Arabic |
11 | Syriac |
12 | Thaana |
13 | Devanagari |
14 | Bengali |
|
# | Range |
15 | Gurmukhi |
16 | Gujarati |
17 | Oriya |
18 | Tamil |
19 | Malayalam |
20 | Thai |
21 | Georgian |
22 | Hangul Jamo |
23 | Ethiopic |
24 | Cherokee |
25 | Unified Canadian Aboriginal Syllabics |
26 | Khmer |
27 | Khmer Symbols |
28 | Mongolian |
29 | Phonetic Extensions |
|
# | Range |
30 | Latin Extended Additional |
31 | Currency Symbols |
32 | Letterlike Symbols |
33 | Number Forms |
34 | Arrows |
35 | Mathematical Operators |
36 | Enclosed Alphanumerics |
37 | Box Drawing |
38 | Geometric Shapes |
39 | Miscellaneous Symbols |
40 | Supplemental Arrows-B |
41 | Kangxi Radicals |
42 | CJK Symbols and Punctuation |
43 | Hiragana |
44 | Katakana |
|
# | Range |
45 | Bopomofo |
46 | Hangul Compatibility Jamo |
47 | Enclosed CJK Letters and Months |
48 | CJK Compatibility |
49 | CJK Unified Ideographs Extension A |
50 | CJK Unified Ideographs |
51 | Yi Syllables |
52 | Yi Radicals |
53 | Hangul Syllables |
54 | CJK Compatibility Ideographs |
55 | Arabic Presentation Forms-A |
56 | CJK Compatibility Forms |
57 | Arabic Presentation Forms-B |
58 | Mathematical Alphanumeric Symbols |
59 | CJK Unified Ideographs Extension B |
|
|
Example(s)
Basic unicode examples
unicode(50) - Will generate 50 unicode chars from all of the Unicode ranges.
|
Generating language specific characters
unicode(50,27) - will generate 50 printable characters from the 'Khmer Symbols' range.
|
Arrows
unicode(50,34) - Use this pattern if you like arrows ;)
|
See also
char - alphabetical character
ascii - ASCII characters