EndOfLine not working on a Mac

Look at the code I provided. I used ConvertEncoding, but you probably need DefineEncoding instead.

now the problem is solved.
I had to Trim() the variables and than it worked. the variables came from a database.

thanks to all

Trim may happen to help in this case but I would not rely on it. You still need to use DefineEncoding to the set the encoding of the database string to whatever encoding it happens to be in.

Please try to understand what’s happening here. The data you read from the database does not know its encoding and that is causing the trouble. Trim might happen to help in some scenarios (although it really shouldn’t in any scenario), but what you really need to use instead is DefineEncoding. DefineEncoding will make the variable usable in the rest of your program.

If you get the diamond with question marks that says “its not OK”
Does the resulting string have an encoding (I’d suspect not)

If you get data from a database then you should use something like

dim var as String = DefineEncoding( recordset.Field(name).StringValue, Encoding.What ever is the right encoding)

to make sure your strings when they come from the DB do have an encoding

Also see this blog post: Why are there diamonds in my user interface?