realbasic-nug
[Top] [All Lists]

Re: 2 quick encoding questions

To: "REALbasic Network Users Group" <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: 2 quick encoding questions
From: "Joseph J. Strout" <joe at realsoftware dot com>
Date: Sun, 29 Feb 2004 19:01:56 -0600
References: <a06020412bc681dc734b2 at [192 dot 168 dot 1 dot 101]>
At 6:11 PM -0500 2/29/04, maclists at additional dot com wrote:

1) Is the text in a text-edit field with System font /always/ UTF8 encoded

No.

 (or, for example, can the user's selected locale or host OS change that)?

It might.

2) How can I get the underlying bytes in a UTF8 string (for example, to transmit them)?

You already have them. If, for example, by "transmit" you mean via a socket, then MySocket.Write theString transmits the bytes.

I can get the byte count using LenB, but then I'm stuck. Do I use Asc or AscB on each character and expect an integer value that will take 1, 2, 3, or 4 bytes to represent, or is there a better way?

I don't understand the question. Why do you want the numeric values of the bytes or characters? Why not just transmit the string?

Best,
- Joe

--

REAL World 2004, The REALbasic User Conference, March 24th-26th
<http://www.realsoftware.com/realworld/index.html>

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

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

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