From a0697179b24fb4a882db214cacd5ab58716b4dd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 2 Dec 2009 10:40:38 +0000 Subject: hmm, it seems like i cleaned up the code sometime ago and forgot to commit svn path=/trunk/externals/iem/unicode/; revision=12818 --- utf82codenumber-help.pd | 76 ++++++++++++++++++++++++++++++------------------- 1 file changed, 46 insertions(+), 30 deletions(-) (limited to 'utf82codenumber-help.pd') diff --git a/utf82codenumber-help.pd b/utf82codenumber-help.pd index 293def1..21b7e03 100644 --- a/utf82codenumber-help.pd +++ b/utf82codenumber-help.pd @@ -1,22 +1,16 @@ -#N canvas 499 69 530 396 10; +#N canvas 1579 140 530 515 10; #X text 44 27 UTF-8 to Unicode code numbers; #X msg 130 58 64; #X floatatom 130 219 0 0 0 3 Unicode_code_number - -; -#X text 161 59 ASCII '@'; -#X text 284 136 Lydian letter A; #X msg 148 136 240 \, 144 \, 164 \, 160; -#X obj 130 162 utf82codenumber; -#X msg 144 83 211 \, 153; -#X text 209 85 schwa; #X msg 147 111 224 \, 188 \, 128; -#X text 248 112 tibetian om; #X text 47 299 this object converts bytestreams of UTF-8 encoded strings and outputs the according Unicode code number of the letters (as stream). ; #X text 51 344 you have to serialize UTF-8 lists as output by e.g. [binfile] and deserialize the Unicode code number lists for use by e.g. [text3d]; -#N canvas 37 117 450 356 example 0; +#N canvas 456 284 616 356 example 0; #N canvas 0 0 450 437 serialize 0; #X obj 131 56 inlet list; #X obj 149 252 list split 1; @@ -40,7 +34,7 @@ e.g. [text3d]; #X connect 6 0 9 0; #X connect 6 1 4 0; #X connect 6 2 8 0; -#X restore 109 103 pd serialize; +#X restore 109 164 pd serialize; #N canvas 0 0 450 300 deserialize 0; #X obj 84 82 inlet done; #X obj 186 81 inlet stream; @@ -61,27 +55,49 @@ e.g. [text3d]; #X connect 7 0 4 1; #X connect 7 1 6 1; #X connect 8 0 6 0; -#X restore 109 207 pd deserialize; -#X obj 149 158 utf82codenumber; -#X obj 109 230 list prepend set; -#X obj 109 253 list trim; -#X msg 109 80 64 211 153 224 188 128 240 144 164 160; -#X text 112 58 a multibyte UTF-8 encoded string; -#X text 107 300 a string of unicode code numbers; -#X msg 109 276; -#X obj 46 230 loadbang; +#X restore 109 237 pd deserialize; +#X obj 109 260 list prepend set; +#X obj 109 283 list trim; +#X text 112 8 a multibyte UTF-8 encoded string; +#X text 107 330 a string of unicode code numbers; +#X msg 109 306; +#X obj 46 260 loadbang; +#X obj 149 199 utf82codenumber; +#X msg 109 30 64 201 153 224 188 128 240 144 164 160; +#X msg 46 280 set; +#X msg 136 129 64 201 153 224 108 128 240 144 164 160; +#X text 134 74 erroneous string: byte#5 indicates new single-byte within +a multi-byte \; therefore character#3 (which depends on byte#5) will +be skipped; +#X obj 251 220 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 +-1 -1; +#X text 274 221 error; #X connect 0 0 1 0; -#X connect 0 1 2 0; +#X connect 0 1 8 0; #X connect 0 2 1 2; -#X connect 1 0 3 0; -#X connect 2 0 1 1; -#X connect 3 0 4 0; -#X connect 4 0 8 0; -#X connect 5 0 0 0; -#X connect 9 0 3 0; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 3 0 6 0; +#X connect 7 0 2 0; +#X connect 8 0 1 1; +#X connect 8 1 13 0; +#X connect 9 0 0 0; +#X connect 10 0 6 0; +#X connect 11 0 0 0; #X restore 330 228 pd example; -#X connect 1 0 6 0; -#X connect 5 0 6 0; -#X connect 6 0 2 0; -#X connect 7 0 6 0; -#X connect 9 0 6 0; +#X msg 144 83 201 \, 153; +#X text 209 85 schwa (U0259 = 601); +#X text 160 58 ASCII '@' (U0040 = 64); +#X text 248 112 tibetian om (U0F00 = 3840); +#X text 284 136 Lydian letter A (U10920 = 67872); +#X obj 130 162 utf82codenumber; +#X obj 232 182 print error; +#X text 52 401 if the bytestream is not a valid UTF-8 stream \, a message +will be send to the 2nd outlet indicating an error. the currently decoded +character will be skipped.; +#X connect 1 0 13 0; +#X connect 3 0 13 0; +#X connect 4 0 13 0; +#X connect 8 0 13 0; +#X connect 13 0 2 0; +#X connect 13 1 14 0; -- cgit v1.2.1