realbasic-nug
[Top] [All Lists]

Encodings changed?

To: REALbasic Network Users Group <realbasic-nug@lists.realsoftware.com>
Subject: Encodings changed?
From: Markus Winter <markus_winter@online.de>
Date: Mon, 29 Jun 2009 22:59:33 +0200
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
Thread-index: Acn4/ICdvvtENmTvEd6KegAX8sP4eQ==
Thread-topic: Encodings changed?
User-agent: Microsoft-Entourage/11.4.0.080122
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>


<Prev in Thread] Current Thread [Next in Thread>