Skip to content

Fix: Ensure consistent character encoding in HTTP response handling#210

Merged
devoxin merged 1 commit into
lavalink-devs:mainfrom
arif-banai:fix/youtube-mojibake
Mar 6, 2026
Merged

Fix: Ensure consistent character encoding in HTTP response handling#210
devoxin merged 1 commit into
lavalink-devs:mainfrom
arif-banai:fix/youtube-mojibake

Conversation

@arif-banai

Copy link
Copy Markdown
Contributor

Summary

This PR ensures that calls to EntityUtils.toString specify UTF_8 character encoding. This resolves issues with mojibake when system default character encoding is NOT UTF_8.

Commit Message

Updated EntityUtils.toString calls to specify StandardCharsets.UTF_8 for consistent character encoding across multiple classes, including CipherManager, Web, and NonMusicClient.

Added .cursor to .gitignore to exclude cursor files from version control.

Updated EntityUtils.toString calls to specify StandardCharsets.UTF_8 for consistent character encoding across multiple classes, including CipherManager, Web, and NonMusicClient. Added .cursor to .gitignore to exclude cursor files from version control.
@devoxin

devoxin commented Mar 6, 2026

Copy link
Copy Markdown
Member

Have you personally run into any issues from the charset not being explicitly defined, or is this just AI junk?

@sqikerz

sqikerz commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

AI slop

ref: #197 (comment)

@arif-banai

arif-banai commented Mar 6, 2026

Copy link
Copy Markdown
Contributor Author

I have personally run into this issue.

I incorporated the changes into my application and it fixed my issue when I was playing music from youtube with cyrillic characters

https://github.com/arif-banai/MusicBot/blob/53edb8efcd7c18b002667f2ba35a9ca569b90535/pom.xml#L276-L286

        <dependency>
            <groupId>com.github.arif-banai</groupId>
            <artifactId>youtube-source</artifactId>
            <version>release~debug-and-mojibake-SNAPSHOT</version>
        </dependency>

I was previously fixing this on the application level (in MusicBot) but this felt wrong. Fixing this upstream so applications don't have to deal with this is preferable.

I can try to provide before and after pictures if that would help convince you.

@arif-banai

Copy link
Copy Markdown
Contributor Author

@sqikerz I am not sure why you are being so hostile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants