js byte size

JavaScript
(new Blob(['20€'])).size;	// 5
Source

Also in JavaScript: