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 5 years have passed since last update.

node.jsで文字列のバイト数を簡単に把握する関数

Posted at

バイト数を求める

javascriptで文字列から、UTF-8でバイト数を求める方法を探してたらどのコードも大変そう、、、
たまたま見かけた、下記の関数がとても便利だったので、メモ。

Buffer.byteLength関数

第一引数に、引用元、第二引数に、文字コードの指定。

公式サイト

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?