pastebin - collaborative debugging tool
rovema.kpaste.net RSS


tojhira1.ksh - towctrans()/ksh93 typeset -M demo
Posted by Anonymous on Tue 21st Feb 2023 16:49
raw | new post

  1. #/usr/bin/ksh93
  2. #
  3. # tojhira1.ksh - towctrans()/ksh93 typeset -M demo
  4. #
  5. # Written by Roland Mainz <roland.mainz@nrubsig.org>
  6. #
  7.  
  8. export LC_ALL='ja_JP.UTF-8'
  9.  
  10. # see which wctrans transformations are supported by the locale
  11. locale -c LC_CTYPE -k | grep -F 'ctype-map-names='
  12.  
  13. typeset -M tojhira x
  14. typeset s
  15.  
  16. typeset -li16 hexcount
  17.  
  18. for (( hexcount=0x0001 ; hexcount < 0x10FFFF ; hexcount++ )) ; do
  19.         s="${ printf "\u[${hexcount#16#}]" ;}"
  20.         x="$s"
  21.        
  22.         if [[ "$s" != "$x" ]] ; then
  23.                 printf $"0x%x/%d:\t%q != %q\n" hexcount hexcount "$s" "$x"
  24.         fi
  25. done
  26.  
  27. print $"done."
  28. # EOF.

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at