Unable upload devices by using csv file #14257
Unanswered
aaanserali
asked this question in
Help Wanted!
Replies: 2 comments
-
The error seems pretty clear to me: your file is not valid UTF-8. It even tells you exactly where the error is, as a byte offset within the file. Hex byte 0xA0 is a non-breaking space in some encodings, e.g. Windows-1252, but if you want to feed this to Netbox you would have to use an external utility to transcode it to UTF-8 first. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Just to show how encoding can work and how you can use iconv to convert text from one encoding to another.
$ python3
Python 3.6.8 (default, Aug 10 2023, 17:01:17)
[GCC 8.5.0 20210514 (Red Hat 8.5.0-20)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>> print(f"asdf{chr(0xa0)}bar")
asdf bar
save that to a text file
$ file testencoding.txt
testencoding.txt: ISO-8859 text, with CRLF line terminators
$ cat testencoding.txt
asdf�bar
$ iconv --from-code=ISO-8859-1 --to-code=UTF-8 testencoding.txt > testencoding2.txt
$ file testencoding*
testencoding2.txt: UTF-8 Unicode text, with CRLF line terminators
testencoding.txt: ISO-8859 text, with CRLF line terminators
$ hexdump --canonical testencoding.txt
00000000 61 73 64 66 a0 62 61 72 0d 0a |asdf.bar..|
0000000a
$ hexdump --canonical testencoding2.txt
00000000 61 73 64 66 c2 a0 62 61 72 0d 0a |asdf..bar..|
0000000b
$ more testencoding.txt testencoding2.txt
::::::::::::::
testencoding.txt
::::::::::::::
asdf�bar
::::::::::::::
testencoding2.txt
::::::::::::::
asdf bar
—
Mark Tinberg ***@***.***>
Division of Information Technology-Network Services
University of Wisconsin-Madison
…________________________________
From: Brian Candler ***@***.***>
Sent: Monday, November 13, 2023 9:08 AM
To: netbox-community/netbox ***@***.***>
Cc: Subscribed ***@***.***>
Subject: Re: [netbox-community/netbox] Unable upload devices by using csv file (Discussion #14257)
The error seems pretty clear to me: your file is not valid UTF-8. It even tells you exactly where the error is, as a byte offset within the file.
Hex byte 0xA0 is a non-breaking space in some encodings, e.g. Windows-1252<https://en.wikipedia.org/wiki/Windows-1252>, but if you want to feed this to Netbox you would have to use an external utility to transcode it to UTF-8 first.
—
Reply to this email directly, view it on GitHub<#14257 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAS7UM44NNGCIALUD67FFODYEIZW3AVCNFSM6AAAAAA7JFV7U6VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TKNJVGE2DA>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am unable to upload devices using the CSV file and am encountering the following error
Beta Was this translation helpful? Give feedback.
All reactions