JavaRush
AI Academy
new
Promotion
Learning
Courses
Tasks
Quizzes
Games
Help
Schedule of nudges
Internship
Community
Users
Forum
Chat
Articles
Activities
Reviews
Subscriptions
Light theme

Lectures

  • Reviews
  • About us
  • CS50
Start
Start learning
Start learning
  • My progress
  • Courses
  • Quest map
  • Lectures
  • What character encoding is and why it matters

    JAVA 25 SELF
    37 level,0 lecture
    We explain what character encoding is and why, without it, computer text turns into “mojibake.” We compare popular sets: UTF-8, Windows-1251, ASCII, Unicode/ UTF-16. We discuss the internal representation of strings in the JVM ( String in Unicode) and proper input/output: explicitly specifying the encoding via InputStreamReader/ OutputStreamWriter and StandardCharsets.UTF_8. Finally — practical examples and common mistakes.
    Open
  • Core encodings: UTF-8, UTF-16, ISO-8859-1

    JAVA 25 SELF
    37 level,1 lecture
    We break down three basic encodings a Java developer encounters: what UTF-8 is (the standard for the web and most formats), how the internal string format in the JVM works — UTF-16 (with surrogate pairs and BOM), and why ISO-8859-1 still appears. We explain compatibility with ASCII, bytes per character, and demonstrate correct encoding handling in Java using StandardCharsets, Files.write, Files.readString, Paths.get. Finally, we cover typical pitfalls: incorrect read/write, the system “default” encoding, confusion between UTF-16/ UTF-8.
    Open
  • Setting the encoding when reading/writing files

    JAVA 25 SELF
    37 level,2 lecture
    How to avoid “mojibake” and make text look the same on all machines: examine the system encoding ( "file.encoding"), work with Charset and the constants in StandardCharsets, read/write via Files . newBufferedReader and Files . newBufferedWriter, use try-with-resources, check available encodings, and follow best practices (by default — "UTF-8"). Finally — common mistakes and how to avoid them.
    Open
  • Encoding mismatches and common errors

    JAVA 25 SELF
    37 level,3 lecture
    In this lecture we examine “mojibake”, character loss ( ?), exceptions like MalformedInputException, the causes (mismatch between Windows-1251/ UTF-8, the system default encoding, BOM), diagnostics ( file.encoding), and best practices: explicitly specifying a Charset, using Files/ BufferedReader with StandardCharsets, avoiding FileReader/ FileWriter, and nuances for XML/ JSON and BOM.
    Open
  • Re-encoding files: reading in one encoding, writing in another

    JAVA 25 SELF
    37 level,4 lecture
    How to correctly read text from a file in one encoding and write it in another using classes from java.nio.file and java.io: use Files.newBufferedReader/ Files.newBufferedWriter or InputStreamReader/ OutputStreamWriter, specify the required Charset, apply try-with-resources, and avoid pitfalls of the system default encoding. Step-by-step algorithm, Windows-1251 → UTF-8 example, nuances (BOM, large files, exceptions), and common mistakes.
    Open
Courses
  • Java Course
  • Python Course
  • Development with Claude Code
  • All 16 courses
University
  • Java FullStack
  • Python FullStack
  • AI Native Developer
  • Web FullStack
Community
  • Articles
  • Forum
  • Help with Tasks
Company
  • About us
  • Contacts
  • Reviews
  • Pricing
  • Questions and answers
JavaRush JavaRush: online courses in Java and other programming languages, where you learn by solving tasks. We started in 2012 with a Java course, and today there are 16 courses: Java and Spring, Python, web development, SQL, Go, C#, C++, Kotlin, Swift, Docker and AI development. More than 10,000 tasks with instant checks, and the first level of any course is free. Learn on your own or with a mentor at JavaRush University.
Follow us
Язык интерфейса
Русский
English
Українська
"Programmers are not born" © 2026 JavaRush Terms of Use and Privacy policy
MastercardVisa
"Programmers are not born" © 2026 JavaRush Terms of Use and Privacy policy