Wednesday, October 13, 2021

exporting Odia html text as Google doc

Exporting a set of Oriya (Odia) language html files stored inside a database to google docs using the usual technique which I had used for English, viz - 

var ablob = Utilities.newBlob(assethtml, MimeType.HTML, "asset.html");
var AssetGDocId = Drive.Files.insert(
{ title: data_array[i][8] + ' temp', // Column I is Asset title
mimeType: MimeType.GOOGLE_DOCS, parents: [{"id": destFolderID}] }, ablob).id;

Did not work. Reason was that the Odia files did not specify the encoding, and consisted of content like


When "good" Odia content was created using Google's phonetic Odia keyboard provided by Google Input Tools, the exported html looks like this, 


The current workaround is to just export the database contents to HTML instead of converting to GDoc. Then, by saving the database contents as a html file, installing the relevant font, opening in LibreOffice Writer (or MS Word, I guess) and then saving as pdf, correctly rendered Odia text is obtained. 


No comments:

Post a Comment