2

I want to upload files(CSV) to my Azure Storage Account (BlobStorage). The BlobStorage is being observed by an Azure Function (BlobTrigger), which is written in TypeScript. index.ts

const blobTrigger: AzureFunction = async function (context: Context, myBlob: any): Promise<void> {
  console.log(myBlob.toString());
  // result:
  // col11, col12, col13
  // col21, col22, col23
  // col31, col32, col33
  // somecharswith-ä, somecharswith-ö, somecharswith-ü
}

function.json

{
  "bindings": [
    {
      "name": "myBlob",
      "type": "blobTrigger",
      "direction": "in",
      "path": "assets",
      "connection": "dbablobstorage_STORAGE"
    }
  ],
  "scriptFile": "../dist/.../index.js"
}

I would like to use simple operations like split() and foreach to transform the CSV values for insert queries. Unfortunately the umlauts ä, ö, ü gets displayed weirdly. I already tried to use Buffer and utf-8 library to encode the string, but without success.

How I get the strings with well-displayed umlauats? Or is there another recommended way to extract the data from CSV files?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.