Convert ANSI Text file to UTF-8 Encoding using Aspose.Words RESTful API

Hi Yishay,

Can you please share your input document and expected document to let us confirm it works in your case as well?

Best Regards,

Attached.

I used character-set OEM-862 on test-before-converted.txt and than converted it to UTF-8 without BOM.
Thanks,
Yishay

Hi Yishay,

Thanks for the sample. We will test it at our end and let you know.

Best Regards,

Hi Yishay,

We were able to reproduce this issue at our end and it has been logged into our issue tracking system as SAASWORDS-247. We will update you as soon as it is resolved.

Best Regards,

Hi Muhammad,


that’s good, do you know approximately when it will be solved?

Many thanks,
Yishay

Hi Yishay,

Our product team is actively working on it and apparently it will not take much time however ETA request has been forwarded to our product team. We will update you as soon as we have any ETA for this issue.

Best Regards,

That’s good to hear.

Many thanks,
Yishay
Hi Yishay,

Thanks for being patient. It is to update you that our product team has resolved your issue SAASWORDS-247 (Support code page when loading text files). You may now please re-test this scenario with Aspose.Words for Cloud. Hope, this helps.

Also, please refer to the 'loadEncoding' option in Common request parameters page.

Best regards,

Thanks for being patient. We have good news for you i.e. SAASWORDS-247 have now been resolved. You may now please re-test your scenario with Aspose.Words for Cloud. Hope, this helps.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi Awais/Muhammad,

I just tried this feature again.

The UTF-8 worked, but OEM-862 encoding didn’t worked.

Maybe I done something wrond, I added the following paramater to the call loadEncoding=oem862, and got something of this sort:

https://api.aspose.com/v1.1/words/test%20skn.txt/SaveAs?loadEncoding=oem862&appSID=XXX&signature=YYY

This issue was set aside by us a few monthes ago, but it might become very dominant in the coming month, so a quick replay will be very appreciated.

Thanks,

Yishay

Hi Yishay,


Thanks for your inquiry. Could you please attach your input text file (test%20skn.txt) here for testing? We will investigate the issue on our end and provide you more information.

Also, please attach your expected/output text file. You can generate this file using the core libraries of your native language such as C#, Java. Please also share the code snippet that you used to generate the expected text file. Thanks for your cooperation.

Best regards,

Hi Awais,


Attached,
Yishay

Hi Yishay,

Thanks for your inquiry. Your “test skn.txt” file seems to be encoded with following:

Code Page: 1252

Charset Label: Windows-1252

Encoding Name: Western European (Windows)

And you can change encoding of this file to Code Page: 862 (Charset Label:DOS-862) by using the following code (see attached encoded .txt file):

AsposeApp.AppSID = “”;

AsposeApp.AppKey = "";

string xml = @"

txt

Encoding_Updated.txt

DOS-862

";

//build URI

string strURI = "http://api.aspose.com/v1.1/words/test skn.txt/SaveAs";

//sign URI

string signedURI = Utils.Sign(strURI);

Utils.ProcessCommand(signedURI, "POST", xml, "xml");

//build URI

strURI = "http://api.aspose.com/v1.1/storage/file/Encoding_Updated.txt";

//sign URI

signedURI = Utils.Sign(strURI);

Stream responseStream = Utils.ProcessCommand(signedURI, "GET");

using (Stream fileStream = System.IO.File.OpenWrite(@"D:\Temp\Encoding_Updated.txt"))

{

Utils.CopyStream(responseStream, fileStream);

}

responseStream.Close();

Please also see saveAs (Controller resource). Hope, this helps.

Best regards,

Hi Awais,


Great answer! I really appreciate the details.
There is only one problem left, I want to convert the document both to UTF-8 and to DOS-862. Is that possible?

Many thanks,
Yishay

Hi Awais,


Just tried sending:
txttest skn_converted.textDOS-862

But I got back the attached file (testing (4).text).
It doesn’t seem to work, we should have got text like:
תומוק

Thanks,
Yishay

Hi Yishay,

Thanks for the additional information. In your case, you don’t need to use TextSaveOptions. Instead, you could simply use the following request to meet this requirement:

http://api.aspose.com/v1.1/words/testskn.txt?format=txt&loadEncoding=DOS-862

But unfortunately, the “loadEncoding” parameter is currently not working as expected. Your thread has been linked to appropriate issue (WORDSCLOUD-67) and you will be notified as soon as this issue is resolved. Sorry for the inconvenience.

Best regards,

Hi Awais,


I also tried running two calls the first with
UTF-8
and the second with
DOS-862
And still didn’t work (file attached).
I also tried DOS-862 first and than UTF-8.

Is there anything else that we can do?

Thanks,
Yishay

Hi Yishay,


Awais:
Thanks for the additional information. In your case, you don’t need to use TextSaveOptions. Instead, you could simply use the following request to meet this requirement:

http://api.aspose.com/v1.1/words/testskn.txt?format=txt&loadEncoding=DOS-862)

But unfortunately, the “loadEncoding” parameter is currently not working as expected. Your thread has been linked to appropriate issue (WORDSCLOUD-67) and you will be notified as soon as this issue is resolved. Sorry for the inconvenience.
We will inform you via this thread as soon as the issue (WORDSCLOUD-67) is resolved. We apologize for any inconvenience.

Best regards,

Hi Awais,


Totally understood this.
I just wanted to understand if there is some way to go around the problem while we wait for the dev team to solve it.

Thanks,
Yishay
Hi Yishay,

Thanks for your inquiry. This issue is currently pending for analysis and is in the queue. Once the issue is analyzed by our product team, we may then be able to provide you a workaround while you wait for a fix to come out. We apologize for your inconvenience.

Best regards,