Encoding error during saving of lyrics for an artist
See original GitHub issueI tried fetching the lyrics of the french rapper Nekfeu and saving them in txt format but I got that error
Traceback (most recent call last): File "lyrics_fetch.py", line 6, in <module> artist.save_lyrics(format = "txt") File "D:\Anaconda3\lib\site-packages\lyricsgenius\artist.py", line 134, in save_lyrics lyrics_file.write(lyrics_to_write) File "D:\Anaconda3\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\ufeff' in position 20121: character maps to <undefined>
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Issue With Encoding Character '\u2005' For Song "Closed on ...
Expected save to requested text file with no issue. This occured while trying to save lyrics for the song "Closed on Sunday" by...
Read more >Java 17 Encoding error during compilation - Stack Overflow
I have a ReaderWriter.java class that is giving encoding errors. ... Encode in the child using the charset "-Dsun.stderr.encoding=" + ...
Read more >Analyzing lyrics from different music genres with universal ...
Applying Google's Universal Sentence Encoder and Principal Component Analysis to identify similarities and differences across music genres.
Read more >3.3.3 Special characters - LilyPond Notation Reference
This means that any text, be it title, lyric text, or musical instruction containing non-ASCII characters, must be encoded in UTF-8.
Read more >[RELEASE] LRC Lyrics - Addon based on XBMC Lyrics
fixed: encoding error when login as non english user name under windows ... added: setting "Save lyrics files in artist folder"
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah encoding errors seems to be a pain in the ass, I also had a problem with another artist where it couldn’t map ō so I decided to use an ugly but working solution for the moment, I simply replaced
lyrics_file.write(lyrics_to_write)
byprint(lyrics_to_write)
and copied and pasted from the console but I’ll try to think about a solution (lyrics_file.write(lyrics_to_write.encode(encoding = 'utf-8', errors = 'ignore').decode(encoding = 'utf-8'))
didn’t work either)Closed by #51. The encoding issues are sure to crop up again in the future though…