eminero
10/17/2023, 8:27 PMconnection.download
method, however I'm dealing with special accented characters (French) like this: Théorêt.
I save the the CSV file in the file cabinet as is, just setting a new name and the right folder, by default, I'm seeing this is saved as UTF_8
encoding, however once I load the file in the next stage, the characters are not recognized. They displayed like this Th�or�t using the log.debug
Opening the file in Excel, Numbers and VSCode the characters display correctly, it is just in the iterator native method that the characters are wrong.
I did some troubleshooting, I'm logging what I'm getting with the connection.download
which is something like this: {"type":"file.File","id":null,"name":"myfile.csv","description":null,"path":"myfile.csv","url":null,"folder":-1,"fileType":"CSV","isText":true,"size":752,"encoding":null,"isInactive":false,"isOnline":false}
So the encoding is NULL
originally but NetSuite set it as UTF_8
what for me seems right, before saving the file I'm also doing a getContents
and with the string returned I'm using a indexOf
to check for special characters but it returns -1
so they are not found.
Do you have any suggestions to be able to read the CSV data in the right way? I have an approach to handle the special characters but I'm not able to perform it since I cannot read the values correctly from the beginning.battk
10/17/2023, 8:40 PMeminero
10/17/2023, 8:57 PMbattk
10/17/2023, 9:05 PMbattk
10/17/2023, 9:06 PMborncorp
10/17/2023, 9:13 PMborncorp
10/17/2023, 9:14 PMborncorp
10/17/2023, 9:15 PMeminero
10/17/2023, 9:23 PMeminero
10/17/2023, 10:25 PMfile -I myfilename
in the terminal, it turns out that it says: text/csv; charset=iso-8859-1
for some files and then text/csv; charset=us-ascii
for others. Does it mean the end users are kind of editing and saving the files using a different program? I was told they are generated automatically for another system and then, the end users just upload them to the SFTP Server, but I have my doubts about it.Anthony OConnor
10/17/2023, 10:37 PMAnthony OConnor
10/17/2023, 10:38 PMAnthony OConnor
10/17/2023, 10:40 PMeminero
10/17/2023, 10:44 PMeminero
10/18/2023, 1:47 AMbattk
10/18/2023, 2:50 AMbattk
10/18/2023, 2:50 AMaaz
10/18/2023, 12:29 PMaaz
10/18/2023, 12:30 PMeminero
10/18/2023, 1:19 PMeminero
10/18/2023, 1:20 PMN/module
.aaz
10/18/2023, 1:22 PMconnection = sftp.createConnection({
username: sftpUser,
url: serverURL,
directory: directory,
hostKey: hostKey,
keyId: keyId
});
aaz
10/18/2023, 1:22 PMeminero
10/18/2023, 1:28 PMaaz
10/18/2023, 1:28 PMaaz
10/18/2023, 1:29 PMaaz
10/18/2023, 1:29 PMaaz
10/18/2023, 1:29 PMaaz
10/18/2023, 1:29 PMeminero
10/18/2023, 1:32 PMaaz
10/18/2023, 1:32 PMaaz
10/18/2023, 1:33 PM