'Tabular Editor 2 - Export measures in unicode file

I am exporting all measures & columns using advanced scripting in tabular editor. It works, but some names are not correct due to Unicode characters that are not saved correctly,

var csvMeasures = ExportProperties(Model.AllMeasures,"Name,Description);
SaveFile("c:\\temp\\TabularMeasures.csv", csvMeasures);

Any way to keek the Unicode chars that are inside the model?



Solution 1:[1]

Use the following script to retain unicode characters in the output:

using System.IO;
using System.Text;

var csvMeasures = ExportProperties(Model.AllMeasures,"Name,Description");
File.WriteAllText("c:\\temp\\TabularMeasures.csv", csvMeasures, Encoding.Unicode);

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dan