When I export a text file, it is encoded as UCS-2 Little Endian. Can I change this? I'd like to encode it as UTF-8.
A little background: I'm exporting comma-delimited text files with the extension csv. I'd like to be able to double-click them in Windows and have Excel open them correctly, but everything goes into column A if the file is UCS-2 Little Endian. If converted to UTF-8 it works fine.
Yes, I'm aware that I can export in Excel format (actually HTML...) and get to Excel that way. I also need csv files that work.
Thank you,
change text export file encoding?
change text export file encoding?
Matt Garrett
CRTech
Boulder, Colorado, USA
CRTech
Boulder, Colorado, USA
Re: change text export file encoding?
Hello MattG,
Thank you for the observation. We can't offer the encoding that you request straight-off as an external variation as the principal method called internally is not publicly visible, but the request is worthwhile us adding as a new feature, to be able to choose the encoding type, so we'll add that for the next version.
As a variation, an interim workaround, a csv delimiter that is likely to work as you require, opening various data columns separately from the csv in Excel would be the default tab character.
eg.
Thanks,
Thank you for the observation. We can't offer the encoding that you request straight-off as an external variation as the principal method called internally is not publicly visible, but the request is worthwhile us adding as a new feature, to be able to choose the encoding type, so we'll add that for the next version.
As a variation, an interim workaround, a csv delimiter that is likely to work as you require, opening various data columns separately from the csv in Excel would be the default tab character.
eg.
Code: Select all
tChart1.Export.Data.Text.TextDelimiter = "\t";
tChart1.Export.Data.Text.Save(@"c:\datafiles\excelchart.csv");
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: change text export file encoding?
Hello MattG,
I inform you that we understand that may not fit well with other requirements you have for the files so we'll alrady get on and make the change suggested, in Feature request. As you see we fixed it and for next version of TeeChartfor.Net you can export DataFormat with optional encoding if you want. I recommend you to be aware at this forum, our RSS news feed, twitter and facebook accounts for new release announcements and what's implemented on them.
Thanks,
I inform you that we understand that may not fit well with other requirements you have for the files so we'll alrady get on and make the change suggested, in Feature request. As you see we fixed it and for next version of TeeChartfor.Net you can export DataFormat with optional encoding if you want. I recommend you to be aware at this forum, our RSS news feed, twitter and facebook accounts for new release announcements and what's implemented on them.
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: change text export file encoding?
Hi Sandra,
Yes, that worked. Thank you. I used TeeChart for .NET 4.1.2013.11080 and the following C++/CLI code:
Yes, that worked. Thank you. I used TeeChart for .NET 4.1.2013.11080 and the following C++/CLI code:
Code: Select all
using namespace Steema::TeeChart;
using namespace System::IO;
Export::DataExport ^SteemaDe = gcnew Export::DataExport(tchart->Chart);
SteemaDe->Text->TextDelimiter = ",";
SteemaDe->Text->TextLineSeparator = "\r\n"; // Windows
FileStream ^out = gcnew FileStream(fn, FileMode::Create);
SteemaDe->Text->Save(out, System::Text::Encoding::UTF8);
out->Close();
Matt Garrett
CRTech
Boulder, Colorado, USA
CRTech
Boulder, Colorado, USA