Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
- C
- Clojure
- C++
- C#
- D
- Dart
- Elixir
- Erlang
- Fortran
- Go
- Haskell
- JS
- Java
- Lisp
- Lua
- Obj-C
- PHP
- Pascal
- Perl
- Python
- Ruby
- Rust
- Scala
- VB
const char * s = "ネコ";
C has no notion of character sets, output depends on locale settings and terminal capabilities.
(def s "ネコ")
string s = "ネコ";
string s = "ネコ";
var s = "ネコ";
S = unicode:characters_to_binary("ネコ"),
use, intrinsic :: iso_fortran_env
implicit none
integer, parameter :: u = selected_char_kind('ISO_10646')
character(kind=u,len=2) :: cat
cat = u_"ネコ"
s = "ネコ"
s = "ネコ";
JavaScript was designed to use unicode.
String s = "ネコ";
Literal strings with UTF-16 characters are legal in Java. Just be careful with your source file encoding, or use escaping.
(defvar *s* "ネコ")
s = 'ネコ'
Lua treats strings as raw bytes, but includes a utf8 table for handling utf8 strings.
NSString *s=@"ネコ";
The (most often used) Clang ObjC compiler assumes source files are UTF-8 and interprets them properly.
$s = "ネコ";
{$codepage utf8}
s := "ネコ";
{$codepage utf8}: Explain to the compiler the file (and therefore a string literal) is UTF8 encoded.
You can assign UTF8 literals.
You can assign UTF8 literals.
my $s = 'ネコ';
The utf8 module tells perl that the source code is encoded in UTF-8 and incidentally allows for Unicode literals and identifiers.
s = "ネコ"
s = "ネコ"
val s = "ネコ"
Dim s As String = "ネコ"