Read file with accented characters ?
Zax
zax at tripoy.com
Mon May 29 09:11:41 EDT 2006
Thanks for your suggestion.
I tried this function but results are not enough accurate.
It's the same problem with all the functions I have already tried : I'm not
able to recognize a MS Word document saved in "simple text" format from a
BBEdit file saved in Mac format... And I need to recognize them because
BBEdit files need to be translated with the built-in IsoToMac function.
Any ideas ?
> Try this function:
>
> function lineEndings pFilePath
> if pFilePath = "" then
> answer file "Choose a file:"
> if it = "" then exit to top
> put it into pFilePath
> end if
> put url ("binfile:"&pFilePath) into tData
> if offset(numToChar(10)&numToChar(13),tData) > 0 then
> return "Windows"
> else if offset(numToChar(10),tData) > 0 then
> return "Unix"
> else if offset(numToChar(13),tData) > 0 then
> return "Mac"
> end if
> return "Unknown"
> end lineEndings
>
> I didn't test it very much, so see what you get.
----------------------
Zax
More information about the use-livecode
mailing list