2013-05-16 5 views

답변

2

네 - 같이, hexdump를 사용

$ echo -n i | hexdump 

이 같은 출력 뭔가 것입니다 어느 :

$ echo ü | hexdump | awk '{print "\\x"toupper(substr($2,3,4)) "\\x"toupper(substr($2,0,2)) "\\x"toupper(substr($3,3,4))}' | head -1 

: 뭔가

0000000 0069        
0000003 

더 포맷, 당신이 할 수 그러면 다음이 출력됩니다 :

여기에서 가져온
\xC3\xBC\x0A 

코드 : 위대한 How do you echo a 4-digit Unicode character in Bash?

+1

. 그리고 8 진수의 경우 :'echo ¡ | hexdump -b'; 십진수 :'echo ¡ | hexdump -d'입니다. – Dhskjlkakdh