We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
I have a spreadsheet that has some unicode values in it. When gspread
To Reproduce
get_values
Expected behavior Expected the values to include the correct unicode characters "é" and "–"
Code example*
import gspread gspreadsheet_url = "https://docs.google.com/spreadsheets/d/1ZmBPLAVf-uwapUH8ep4n9mUHbv2kKDb8yw-wqgjsIfk/edit" gclient, AUTHORIZED_USER = gspread.oauth_from_dict(credentials, AUTHORIZED_USER) gspreadsheet = gclient.open_by_url(gspreadsheet_url) gsheet = gspreadsheet.get_worksheet_by_id("0") values = gsheet.get_values() print(values)
Screenshots n/a
Environment info:
Stack trace or other output that would be helpful n/a
Additional context cc @weichangyuan-phd
The text was updated successfully, but these errors were encountered:
hi ! thanks for submitting the issue :]
thanks for providing an example sheet and code example !
using the sheet you provided (copied here)
and this code:
import gspread SPREADSHEET_ID = "1ZmBPLAVf-uwapUH8ep4n9mUHbv2kKDb8yw-wqgjsIfk" gc = gspread.service_account(filename="./creds.json") gspreadsheet = gc.open_by_key(SPREADSHEET_ID) gsheet = gspreadsheet.sheet1 values = gsheet.get_values() for rowi, row in enumerate(values): for coli, cell in enumerate(row): print(f"column {coli}, row {rowi}") print(" string: ", cell) print(" bytes: ", cell.encode("utf-8"))
I get the following result:
$ py 1538-unicode-characters.py column 0, row 0 string: names bytes: b'names' column 0, row 1 string: Single Serve Entrée bytes: b'Single Serve Entr\xc3\xa9e' column 0, row 2 string: Micro Dosed – Fountain bytes: b'Micro Dosed \xe2\x80\x93 Fountain'
to me, then, it seems like there is no issue. Perhaps the problem is with your terminal or how you use the result?
my environment is:
gspread 6.1.4 with Python 3.10.12 on Linux Pop!_OS 22.04 LTS x86_64
Sorry, something went wrong.
No branches or pull requests
Describe the bug
I have a spreadsheet that has some unicode values in it. When gspread
To Reproduce
get_values
method (see code sample below).Expected behavior
Expected the values to include the correct unicode characters "é" and "–"
Code example*
Screenshots
n/a
Environment info:
Stack trace or other output that would be helpful
n/a
Additional context
cc @weichangyuan-phd
The text was updated successfully, but these errors were encountered: