Weird question marks/diamonds appearing in Cocoa TextArea

Take a look at this screen grab:

Those black diamonds with a question mark in them are supposed to be carriage returns / new lines. I am appending text programmatically to the TextArea periodically and I can’t figure out what those black diamonds are.

It doesn’t seem to matter if I use EndofLine(), Chr(13) or Chr(10).

Any thoughts?

1 Like

[quote=17577:@Garry Pettet]Take a look at this screen grab:

Those black diamonds with a question mark in them are supposed to be carriage returns / new lines. I am appending text programmatically to the TextArea periodically and I can’t figure out what those black diamonds are.

It doesn’t seem to matter if I use EndofLine(), Chr(13) or Chr(10).

Any thoughts?[/quote]

Your string has either a Nil encoding or an incorrect encoding for the bytes specified.

1 Like

That’s odd.

In a thread I have a string variable called LogText that I periodically update as I do things in the thread.

A timer on the window with the TextArea periodically appends the content of LogText to the TextArea and then clears LogText. I’m protecting LogText with a CriticalSection.

Where would I specify the encoding? The TextArea is read-only so the only text being added to it is via code (and I would have therefore thought UTF-8).

I’m on OS X 10.8.

1 Like

When you read it from the DB since I’m pretty sure I know where you get this :stuck_out_tongue:

dim s as string = DefineEncoding( recordset.field(“fieldname”).StrinValue , Encodings.UTF8 )

1 Like

Ah.

That was it. Thanks!

1 Like

Yes, that was it! (was just having the identical problem :-D) Thanks!

1 Like