R
R
Rienopely2015-09-24 07:59:11
Java
Rienopely, 2015-09-24 07:59:11

Why is the encoding not displayed correctly?

In general, there are lines in UTF-8 encoding. So, this paskuda (my program) in JTextPane in NetBeans, if you just run it, displays the encoding correctly. But if you collect and clean this creature and go to the folder where this reptile was collected and run from there, then this skatina displays kryakozyabry. JTextPane.setContentType was specifying. The encoding is exactly UTF-8. Please help me correct this error. And here are the screenshots.a71172ccca0c4e7687e55a0d1daf4f57.PNGf4b946fbaa044a5b88fcfe4f6961f20c.PNG

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Cheremisin, 2015-09-24
@rienopely

Briefly, you have not specified the encoding of the input stream. Since everything is in Unicode inside, when reading a stream, you simply need to specify the encoding in which this stream lies. The same is true when recording, look at the encoding. All this is well described in the article "java Russian letters and more". Just like that, drive it into Google. If something is not clear, write in the comments.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question