PureBasic 5.50 final is out !

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
mk-soft
Always Here
Always Here
Posts: 5406
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: PureBasic 5.50 beta 1 is out

Post by mk-soft »

Thanks to PB Team,

I think it´s no problem with unicode.

But I need a very fast conversion between ascii and unicode.
In industry, many devices can be used with ascii protocol

I like this

Code: Select all

Macro Unicode(mem, type = #PB_Ascii)
  PeekS(mem, -1, type)
EndMacro

*mem1 = Ascii("Hallo World: Characters - äöüß")
*mem2 = UTF8("Hallo World: Characters - äöüß")

string.s = Unicode(*mem1)
Debug string

string.s = Unicode(*mem2, #PB_UTF8)
Debug string
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
thanos
Enthusiast
Enthusiast
Posts: 422
Joined: Sat Jan 12, 2008 3:25 pm
Location: Greece
Contact:

Re: PureBasic 5.50 beta 1 is out

Post by thanos »

@Fred
Thank you very much for one more time! :shock:
» myPersonal Banker :: Because you do not need to have a master degree in economics in order to organize your finances!
User avatar
Bananenfreak
Enthusiast
Enthusiast
Posts: 519
Joined: Mon Apr 15, 2013 12:22 pm

Re: PureBasic 5.50 beta 1 is out

Post by Bananenfreak »

For a few months I was not online in this forum...
And now there's a new Beta with cool new features for the 3D-Engine :shock:
Dear Purebasic team, many thanks and thumbs up for you :D
Image
User avatar
DK_PETER
Addict
Addict
Posts: 898
Joined: Sat Feb 19, 2011 10:06 am
Location: Denmark
Contact:

Re: PureBasic 5.50 beta 1 is out

Post by DK_PETER »

Thank you very much!
Especially for the new 3D features.
Time to test these new additions. :wink:
Current configurations:
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.
le_magn
Enthusiast
Enthusiast
Posts: 135
Joined: Wed Aug 24, 2005 12:11 pm
Location: Italia
Contact:

Re: PureBasic 5.50 beta 1 is out

Post by le_magn »

Thank you very much
Image
User avatar
Psychophanta
Addict
Addict
Posts: 4997
Joined: Wed Jun 11, 2003 9:33 pm
Location: Lípetsk, Russian Federation
Contact:

Re: PureBasic 5.50 beta 1 is out

Post by Psychophanta »

Thank you from heart! :)
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB :mrgreen:
flood
User
User
Posts: 31
Joined: Sun Aug 14, 2011 10:32 pm

Re: PureBasic 5.50 beta 1 is out

Post by flood »

Good work. Any chance for ogre terrain paging in a future update?
User avatar
Tristano
Enthusiast
Enthusiast
Posts: 190
Joined: Thu Nov 26, 2015 6:52 pm
Location: Italy
Contact:

Re: PureBasic 5.50 beta 1 is out

Post by Tristano »

Is the Unicode-only mode going to affect Windows console applications?

I've just finished a console project with PB 5.42, and I had to compile it in Ascii mode because I realized that in Unicode mode error messages sent to STDERR were posing problems under certain conditions. If I used the app directly from CMD, no problems whatsoever, but if I invoked it from a batch script, redirecting its outuput, then STDERR messages would end up in the (redirected) file with NUL chars inbetween each char. So, with Unicode compilation, this approach worked fine:

Code: Select all

myapp.exe 2> file.txt
but if I created a batch file with such a line:

Code: Select all

REM this is mybatch.bat
myapp.exe
and invoked it thus:

Code: Select all

mybatch.bat 2> file.txt
Then the NUL inbetween chars would popup! Somehow, the problem only applied to ConsoleError().

I gather that this is because of the limited way Windows CMD handles Unicode:
CMD.exe only supports two character encodings Ascii and Unicode (CMD /A and CMD /U)

If you need full unicode support use PowerShell. There is still VERY limited support for unicode in the CMD shell, piping, redirection and most commands are still ANSI only. The only commands that work are DIR, FOR /F and TYPE, this allows reading and writing (UTF-16LE / BOM) files and filenames but not much else.
http://ss64.com/nt/chcp.html
In my case, after a few tests, I realized the problem was specific to PB's ConsoleError() function — the problem didn't show up with Print() or Print() funcs— so I ended up compiling it in Ascii mode.

With the passage to Unicode-only mode, how will PB handle such cases?

Are the console-related functionalities going to be adapted to handle such issues?

I know ... its a real bummer that Windows CMD still handles badly Unicode, especially when redirecting, and that not all of the CMD commands are Unicode compliants. Still, PowerShell is not a panacea for every situation -- and if you create a console app, chances are that people will invoke them from CMD.

I hope that coming updates of PB will address these issues, strengthening the Console library behaviour on Windows, making it true cross-platform — ie: allowing users not to worry about such issues, having one code for all OSs'.

Else, it might be a problem to continue to create console apps for Windows using PB — that is, without resorting to WinAPI libs, which would break cross-platformness of the app.
The PureBASIC Archives: FOSS Resources:
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Re: PureBasic 5.50 beta 1 is out

Post by Mistrel »

Fred wrote:You can't seek directly to a specific char, which is a problem for many string functions which requiers an offset to a char. You need to parse all the char to get the right index, which is a bottleneck when dealing with a lot of string op.
This was never a good arguments as UTF-16 has surrogate pairs and composite codepoints. Even UTF-32 does not have this guarantee.

Even if you were to limit yourself to the obsolete UCS-2 then you still have endianess to consider.
User avatar
NicknameFJ
User
User
Posts: 90
Joined: Tue Mar 17, 2009 6:36 pm
Location: Germany

Re: PureBasic 5.50 beta 1 is out

Post by NicknameFJ »

Thank you Fred for the new Beta.

All my projects compiling very well with the new version.


Greetings


NicknameFJ
PS: Sorry for my weird english, but english is not my native language.



Image
User avatar
aaaaaaaargh
User
User
Posts: 55
Joined: Thu Jul 27, 2006 1:24 pm

Re: PureBasic 5.50 beta 1 is out

Post by aaaaaaaargh »

My Application relies heavily on Scintilla and the Unicode stuff messes that up in a big way :-(
User avatar
Tenaja
Addict
Addict
Posts: 1949
Joined: Tue Nov 09, 2010 10:15 pm

Re: PureBasic 5.50 beta 1 is out

Post by Tenaja »

aaaaaaaargh wrote:My Application relies heavily on Scintilla and the Unicode stuff messes that up in a big way :-(
I replaced calls to scintilla with calls that manage the conversion. You really should be doing that anyway, unless you do not plan on sharing your program with anybody else, because non-ascii characters are much more common than most Americans are aware of.
User avatar
aaaaaaaargh
User
User
Posts: 55
Joined: Thu Jul 27, 2006 1:24 pm

Re: PureBasic 5.50 beta 1 is out

Post by aaaaaaaargh »

Tenaja wrote:
aaaaaaaargh wrote:My Application relies heavily on Scintilla and the Unicode stuff messes that up in a big way :-(
I replaced calls to scintilla with calls that manage the conversion. You really should be doing that anyway, unless you do not plan on sharing your program with anybody else, because non-ascii characters are much more common than most Americans are aware of.
Yeah, that is what I'll be doing soon. Well, we have the luxury of an LTS version with PB so there should be plenty of time to get those conversions done.
Many thanks to the PB Team for their continuing efforts, you rock!
supercdfr
User
User
Posts: 54
Joined: Tue Mar 16, 2010 9:28 pm

Re: PureBasic 5.50 beta 1 is out

Post by supercdfr »

Code: Select all

  Decoded$ = Space(1024) 
  Encoded$ = "aGVsbG8gd29ybGQ="

  Debug Base64Decoder(@Encoded$, StringByteLength(Encoded$), @Decoded$, 1024)
  Debug Decoded$
No unicode -> HELLO WORLD
unicode -> chinese, and i don't speak chinese. :?

And it come from official base64.
infratec
Always Here
Always Here
Posts: 6874
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: PureBasic 5.50 beta 1 is out

Post by infratec »

supercdfr wrote:

Code: Select all

  Decoded$ = Space(1024) 
  Encoded$ = "aGVsbG8gd29ybGQ="

  Debug Base64Decoder(@Encoded$, StringByteLength(Encoded$), @Decoded$, 1024)
  Debug Decoded$
No unicode -> HELLO WORLD
unicode -> chinese, and i don't speak chinese. :?

And it come from official base64.
Again someone who not know how to handle that stuff.
Maybe it would be a good decission that the Decoder itself change the incoming *buffer (which is always a string) to ASCII.

Code: Select all

Result = Base64Decoder(Encoded$, *outbuffer, outlength.i)
As hint:
Base64Decoder don't expect a string it expects a buffer with an ASCII string inside.
So you have to use Pokes(*encodebuffer, Encode$, -1, #PB_Ascii|#PB_String_NoZero)

Code: Select all

Encoded$ = "aGVsbG8gd29ybGQ="

*encodebuffer = AllocateMemory(StringByteLength(Encoded$))
If *encodebuffer
  PokeS(*encodebuffer, Encoded$, -1, #PB_Ascii|#PB_String_NoZero)
  *outbuffer = AllocateMemory(MemorySize(*encodebuffer) * 0.8)
  If *outbuffer
    Length = Base64Decoder(*encodebuffer, MemorySize(*encodebuffer), *outbuffer, MemorySize(*outbuffer))
    Debug PeekS(*outbuffer, Length, #PB_Ascii)
    FreeMemory(*outbuffer)
  EndIf
  FreeMemory(*encodebuffer)
EndIf
Bernd
Last edited by infratec on Wed Jun 22, 2016 7:26 pm, edited 1 time in total.
Post Reply