The trouble (in your second example) came from TextEdit:

TextEdit assume an encoding at open time; so if you choose none, it use MacRoman (not UTF8)... in the preferences, set the Read/Write encodings to UTF-8 and you will be done.

Emile

[EMAIL PROTECTED] wrote:

Subject: TextOutputStream and encodings
From: Arnaud Nicolet <[EMAIL PROTECTED]>
Date: Tue, 2 May 2006 13:41:37 +0200

Hi,

An encoding question, again.
I'm trying this simple code:

dim t as textOutputStream

t=MyFile.CreateTextFile
if t=nil then
MsgBox "Can't save the file: error "+str(f.LastErrorCode)+"."
Return True
end if
t.Write EFMyText.Text
t.Close

The text is supposed to have high-ascii characters because of my current language. Then, I open the file using TextEdit. The file does not have the correct encoding (well, it can be expected).

So I change
t.write EFMyText.Text
to
t.Write ConvertEncoding(EFMyText.Text,Encodings.UTF8)
(the magically used UTF8)

but the problem remains.

Is it possible to write to a text file (no rtf data) so that it "knows" the wanted encoding?
(I guess it should, otherwise, what a problem around the world!)

I guess I can tell TextEdit to use a specific encoding when I open the file, but I doubt it's the correct way (I would prefer to have saved the file correctly rather than repairing when the file is open later, with any application).

Any comment welcome.

  5. Re: PASSWORD PROTECTED data in Text file saved how?
     (Jonathon Bevar)
  6. Re: LDAP in RB (Norman Palardy)
  7. Re: Compelling reasons to upgrade? (Jayson Garrett)
  8. Re: SOAP and mime/Multipart (Jason Essington)
  9. Re: PASSWORD PROTECTED data in Text file saved how?
     (Charles Yeomans)
 10. Re: Compelling reasons to upgrade? (Ronald Vogelaar)
 11. Re: listbox problems (Jason Toews)
 12. Re: New HTMLViewer Question (Steve Garman)
 13. Re: Compelling reasons to upgrade? (Lars Jensen)
 14. Re: Compelling reasons to upgrade? (Keith DeLong)
 15. Re: PASSWORD PROTECTED data in Text file saved how?
     (Maarten de Vries)
 16. Class Interface Properties (Maarten de Vries)
 17. Re: Class Interface Properties (Aliacta)
 18. Re: Class Interface Properties (Maarten de Vries)


----------------------------------------------------------------------

Message: 1
Subject: Re: LDAP in RB
From: Aliacta <[EMAIL PROTECTED]>
Date: Tue, 2 May 2006 12:37:41 +0200

Hi Gerrit,

I remember somebody had the same question on this list maybe two years ago, but I haven't heard or read anything ever since that would make me think there's ever been a (third party) solution for it.

There's something called OpenLDAP (http://www.openldap.org/) that could perhaps be rolled into an RB plugin, if the license allows it.

Cheers,

Marc

I searched the internet and these forums but can't realy find something
useful.

Can anyone tell me (some kind of tutorial, or code snippet) how LDAP works
in realbasic or how to get started ?

Thnx in advance


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


==================================================

Message: 2
Subject: TextOutputStream and encodings
From: Arnaud Nicolet <[EMAIL PROTECTED]>
Date: Tue, 2 May 2006 13:41:37 +0200

Hi,

An encoding question, again.
I'm trying this simple code:

dim t as textOutputStream

t=MyFile.CreateTextFile
if t=nil then
MsgBox "Can't save the file: error "+str(f.LastErrorCode)+"."
Return True
end if
t.Write EFMyText.Text
t.Close

The text is supposed to have high-ascii characters because of my current language. Then, I open the file using TextEdit. The file does not have the correct encoding (well, it can be expected).

So I change
t.write EFMyText.Text
to
t.Write ConvertEncoding(EFMyText.Text,Encodings.UTF8)
(the magically used UTF8)

but the problem remains.

Is it possible to write to a text file (no rtf data) so that it "knows" the wanted encoding?
(I guess it should, otherwise, what a problem around the world!)

I guess I can tell TextEdit to use a specific encoding when I open the file, but I doubt it's the correct way (I would prefer to have saved the file correctly rather than repairing when the file is open later, with any application).

Any comment welcome.

==================================================

Message: 3
Subject: Re: Compelling reasons to upgrade?
From: Brad Rhine <[EMAIL PROTECTED]>
Date: Tue, 2 May 2006 07:54:12 -0400

On May 2, 2006, at 3:41 AM, Ronald Vogelaar wrote:

With the release of Metropolis 2k6r1 for Windows mere weeks away now, I wonder: are there compelling reasons to upgrade from RB2005 to RB2006? I've been so focused on my own work that I missed all the discussions that no doubt have taken place. Rather than having to wade through the countless posts from 'back then', could someone sum up the benefits of upgrading before starting/continuing my next project?

One of the big ones for me is that 2006r2 now uses the correct System font on Windows builds. It's a small thing, but it makes a big difference in helping your app to appear platform-correct.

--
Brad Rhine
[EMAIL PROTECTED]
http://bradrhine.com

==================================================

Message: 4
Subject: Re: listbox problems
From: CV <[EMAIL PROTECTED]>
Date: Tue, 2 May 2006 05:54:05 -0700


On May 1, 2006, at 8:23 PM, Jason Toews wrote:
. The existing listingObject in the row is replaced by the updated one.


How is this done? Do you set the existing listingObject to nil? Or keep it and assign the data from the updated one into the existing one?


Best,

Jack

==================================================

Message: 5
Subject: Re: PASSWORD PROTECTED data in Text file saved how?
From: "Jonathon Bevar" <[EMAIL PROTECTED]>
Date: Tue, 2 May 2006 07:58:33 -0600

Joe,

Thanks for the answer to question one.

"(I'm assuming that you have gone through the tutorials that come with RB, and mastered the basics of reading and writing files, designing windows and menus, etc.)" Now as for reading the LR, umm well kinda-sorta read it. I mostly read it when I need to, so I did read about the MD5, but not to the point as doing anything without a little help. I learn best by having someone show me a simple code then letting me work on it and playing with it to understand HOW and WHY it works.

"Using TextInputStream as usual. Remember that you can't undo this MD5 hash; you just read it in, and then compare it to the MD5 of whatever the user enters for a password to see if it matches." Ok here is where a little simple code will help me out most.

We (I) have this:

// Write User/Password Code to text file
 Dim strout As TextOutputStream
 Dim f As FolderItem
f = GetFolderItem("").Child("PatientLog_UPC.ini")
 if f <> Nil then
   strout = f.CreateTextFile
   strout.WriteLine userName.text
   strout.WriteLine MD5( userPassword.text )
   strout.Close
 end if
MsgBox("The User's Name and Password has been saved. Please press 'OK' to continue...")
 Self.Close


// Read User/Password Code from text file
 Dim strin As TextInputStream
 Dim f As FolderItem
 f = GetFolderItem("").Child("PatientLog_UPC.ini")
 If r.exists then
   if f <> Nil then
     strin = f.OpenAsTextFile
     userName.text = strin.ReadLine
     userPassword.text = strin.ReadLine
     strin.Close
   end if
 End if

Ok, now what do I do?

Jonathon


----- Original Message ----- From: <[EMAIL PROTECTED]>
To: "REALbasic NUG" <[email protected]>
Sent: Monday, May 01, 2006 10:07 PM
Subject: Re: PASSWORD PROTECTED data in Text file saved how?


On May 02, 2006, at 01:19 UTC, Jonathon Bevar wrote:

Ok, tell me this about the line of code:

myOutputStream.WriteLine MD5( thePassword )

thePassword?  Is this the Editfield text, like this - thePassword.text?
Yes, or whatever variable or property you've previously stored the password in.

Now, we got the writing TO the text file, now how do I read FROM it?
Using TextInputStream as usual. Remember that you can't undo this MD5 hash; you just read it in, and then compare it to the MD5 of whatever the user enters for a password to see if it matches.

(I'm assuming that you have gone through the tutorials that come with RB, and mastered the basics of reading and writing files, designing windows and menus, etc.)

Best,
- Joe

--
Joe Strout -- [EMAIL PROTECTED]
Available for custom REALbasic programming or instruction.

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>




--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.385 / Virus Database: 268.5.1/327 - Release Date: 4/28/2006







_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to