Real Software Forums
http://forums.realsoftware.com/

String <> String?
http://forums.realsoftware.com/viewtopic.php?f=6&t=47839
Page 1 of 1

Author:  WolfB [ Fri May 10, 2013 12:43 am ]
Post subject:  String <> String?

Hello all,
I have tried this simple code:

Dim s As String
s=chr(&hFE)+ chr(&hFE)+ chr(&h76) + chr(&hE0)+ chr(&h03)+ chr(&hFD)


Should give a binary chain of "FE FE 76 EO 03 FD". In REAL Studio 2011 Release 4.2 is does so.

In Real Studi0 2012 Release I receive "C3 BE C3 BE 79 C3 A0 03 C3 BD".

Well, this looks like UDF-8 coding, but why???

Any ideas?

Greetings
Wolfgang

Author:  Thom McGrath [ Fri May 10, 2013 1:16 am ]
Post subject:  Re: String <> String?

Use Encodings.ASCII.Chr instead.

Author:  timhare [ Fri May 10, 2013 2:05 am ]
Post subject:  Re: String <> String?

Chr() has always supposed to be UTF-8, but it made an exception for values from 128-255, where it functioned like ChrB(). They corrected that bug. Use ChrB() instead. Or Encodings.ASCII.Chr().

Author:  WolfB [ Fri May 10, 2013 3:33 am ]
Post subject:  Re: String <> String?

Thank you Thom and Tim!

thought it would have a very simple solution! So simple that is is always hard to find! ;-)

Now all works as it should!

Wolf

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/