diff options
Diffstat (limited to 'testdata/scad/misc/string-unicode.scad')
-rw-r--r-- | testdata/scad/misc/string-unicode.scad | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/testdata/scad/misc/string-unicode.scad b/testdata/scad/misc/string-unicode.scad index d8e3e5c..1386d63 100644 --- a/testdata/scad/misc/string-unicode.scad +++ b/testdata/scad/misc/string-unicode.scad @@ -1,3 +1,12 @@ +//Test length reporting +text_1bytes_len = "1234"; +text_2bytes_len = "ЛЛЛЛ"; +text_4bytes_len = "🂡🂱🃁🃑"; + +echo( "text_1bytes_len = ", text_1bytes_len, " len = ", len(text_1bytes_len) ); +echo( "text_2bytes_len = ", text_2bytes_len, " len = ", len(text_2bytes_len) ); +echo( "text_4bytes_len = ", text_4bytes_len, " len = ", len(text_4bytes_len) ); + //Test how well arrays of unicode string are accessed. texts_array = [ @@ -33,4 +42,3 @@ echo( "Past end of unicode only 4-byte ", text_4bytes[len(text_4bytes)] ); echo( "Past end of both 2-byte ", text_2bytes[ len(text_2bytes) * 2 ] ); echo( "Past end of both 4-byte ", text_4bytes[ len(text_4bytes) * 4 ] ); - |