Hi all,
if I have a text file created on a Mac, drop it into my project, and put it
into an editfield with
EditField1.text = MacFile
then it displays correctly in RB2007R3 it seems MacRoman is used as the
default encoding.
see http://ahatfullofsky.comuv.com/files/bugs/RB2007R3.jpg
However in RB2009R2 the display is quite different see
http://ahatfullofsky.comuv.com/files/bugs/RB2009R2.jpg
Does anyone know the exact nature of the change and when it happened? I
presume that now UTF8 is used as the default encoding, and not the system
one?
A second question: from the LR I adapted the following code:
Dim f As FolderItem
Dim t As TextInputStream
Dim s As String
Dim enc as TextEncoding
f=GetOpenFolderItem("text") //file type defined via the FileType class
t=f.OpenAsTextFile
s=t.ReadAll
t.Close
enc=s.Encoding
Exception err as NilObjectException
MsgBox err.message
to
Dim enc as TextEncoding
s = Macfile
enc=s.Encoding
Exception err as NilObjectException
MsgBox err.message
Although enc is Nil no error is raised and no MsgBox is being displayed.
If I however test with
if enc = Nil then
MsgBox "No encoding defined"
else
MsgBox enc.internetName
end if
then I get the message box. What is the difference here?
Thanks
Markus
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|