0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

文字のbyte配列変換について

Last updated at Posted at 2021-06-29

文字コード表(UTF-8の場合)
ひらがなは、UTF-8だと3バイト文字と定義されている
「あ」を例にすると、以下のようになっている
image.png
http://orange-factory.com/sample/utf8/code3/e3.html#Hiragana

文字からバイト配列を取得すると、以下のようになる
3バイト文字なので、配列の要素数は3つとなり、各要素に、上記表の10進数値が格納されている
image.png

文字列をバイト配列に変換するということはよくやるけど、
格納されている値の意味まできちんと考えたことが無かったので自分用にメモしておく

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?