Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Fortran

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)

  use, intrinsic :: iso_fortran_env
  implicit none
  integer, parameter :: u = selected_char_kind('ISO_10646')

  character(kind=u,len=2) :: cat
  cat = u_"ネコ"
const char * s = "ネコ";

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

New implementation...