Languages
[Edit]
EN

Java - convert String to UTF-8 bytes

9 points
Created by:
Indira
499

In this short article we would like to show how to convert String to UTF-8 bytes in Java.

Quick solution:

Practical examples

Edit

1. Conversion with predefined property

Edit

Java 1.7 introduced StandardCharsets class with predefined properties.

2. Conversion with charset name

Edit

Using charset name we are able to make String conversion too. 

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Java - String conversion

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join