Files
wren/test/language/string/unicode_escapes.wren
T

25 lines
714 B
Plaintext
Raw Normal View History

2014-01-05 12:27:12 -08:00
// One byte UTF-8 Sequences.
2015-09-15 07:46:09 -07:00
System.print("\u0041") // expect: A
System.print("\u007e") // expect: ~
2014-01-05 12:27:12 -08:00
// Two byte sequences.
2015-09-15 07:46:09 -07:00
System.print("\u00b6") // expect: ¶
System.print("\u00de") // expect: Þ
2014-01-05 12:27:12 -08:00
// Three byte sequences.
2015-09-15 07:46:09 -07:00
System.print("\u0950") // expect: ॐ
System.print("\u0b83") // expect: ஃ
2014-01-05 12:27:12 -08:00
// Capitalized hex.
2015-09-15 07:46:09 -07:00
System.print("\u00B6") // expect: ¶
System.print("\u00DE") // expect: Þ
2014-01-05 12:27:12 -08:00
2015-10-03 17:28:25 +01:00
// Big escapes:
var smile = "\U0001F603"
var byteSmile = "\xf0\x9f\x98\x83"
System.print(byteSmile == smile) // expect: true
System.print("<\U0001F64A>") // expect: <🙊>
System.print("<\U0001F680>") // expect: <🚀>
System.print("<\U00010318>") // expect: <𐌘>