-
Import data encoding App Web
Hi everyone,
I need help regarding an import method for a web application.
Right now, the method works but only for one type of encoding :
//For UTF-8 encoding type:
Do iJSFileRow.$loadcols()
Do iJSMimeList.$search(low(iJSMimeList.name)=’content-disposition’;kTrue;kFalse;kFalse;kFalse)
Do iJSFileMimeList.$line.$assign(1)
Calculate iFileName as iJSMimeList.value
Do utf8tochar(tJSFileBinData) Returns iImport
————————–
//For ANSI encoding type:
Do iJSFileRow.$loadcols()
Do iJSMimeList.$search(low(iJSMimeList.name)=’content-disposition’;kTrue;kFalse;kFalse;kFalse)
Do iJSFileMimeList.$line.$assign(1)
Calculate iFileName as iJSMimeList.value
Do uniconv(kUniTypeAnsiLatin1;tJSFileBinData;kUniTypeUTF8;iImportNat;kTrue;errtext()) Returns #F
Do utf8tochar(iImportNat) Returns iImport
The thing is, I have to make it possible for the user to import a file, regardless of its encoding type (most likely either UTF-8 or ANSI).
Does someone has an idea on how to do it or do I have to add a checkbox for the user to declare the encoding of his file?
Regards,
Coralie.
Sorry, there were no replies found.
Log in to reply.