Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Handling German letter in file content.

vinothree January 31, 2019

I am using Bitbucket REST API in python script to get the file content from Bitbucket, but I got UnicodeEncodeError since the file contains umlauts character in it, So I used iso-8859-1 encoding as below,

    output = obj.text
    try:
       print(output)
    except UnicodeEncodeError as e:
       output = obj.text.encode('iso-8859-1')
       print(output)

Here the encode done successfully without any further issue, but after the encode the newline characters are converted as literal '\n' characters. So unable to process the encoded file content. How to fix the newline character issue ?

1 answer

0 votes
Gonchik Tsymzhitov
Community Champion
April 11, 2019

Hi! 

What about using python3 ? Which will cover utf-8

Cheers,

Gonchik

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events