Logo

Programming-Idioms

  • Lua
  • Rust

Idiom #24 Assign to string the japanese word ネコ

Declare a new string s and initialize it with the literal value "ネコ" (which means "cat" in japanese)

let s = "ネコ";

Make sure to always save your source code files as UTF-8.
s = 'ネコ'

Lua treats strings as raw bytes, but includes a utf8 table for handling utf8 strings.
const char * s = "ネコ";

C has no notion of character sets, output depends on locale settings and terminal capabilities.

New implementation...