It is currently Mon Dec 17, 2018 11:10 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 211 posts ]  Go to page Previous  1 ... 11, 12, 13, 14, 15  Next
Author Message
 Post subject: Re: Removing 'ASCII' switch from PureBasic
PostPosted: Fri Aug 22, 2014 2:36 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Apr 26, 2003 8:26 am
Posts: 2916
Location: Planet Earth
@infratec:
Just change your compiler Defaults to UNICODE, and write all new codes with UNICODE in mind.
It is really not a big problem, after you got used to it. I wrote libs for Win+Linux+Mac with this
settings (for example HIDAPI and ChartDirector cross-platform wrappers.).
Of course you should prefer Unicode style, so paths work correctly for User_Russion and Xiang Xu, too.


Top
 Profile  
Reply with quote  
 Post subject: Re: Removing 'ASCII' switch from PureBasic
PostPosted: Fri Aug 22, 2014 3:56 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Dec 23, 2009 10:14 pm
Posts: 2760
Location: Boston, MA
I'm with Infratec. I made many many changes and it is not fun or elegant. Despite the perception that Unicode is the future, Ascii strings are pervasive in the machine world. Sadly, we must resort to peeks and pokes natively. I am hoping a future version will re-introduce a new 1 byte string datatype that can coexist with multi-byte. :idea:

_________________
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum


Top
 Profile  
Reply with quote  
 Post subject: Re: Removing 'ASCII' switch from PureBasic
PostPosted: Fri Aug 22, 2014 4:55 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 31, 2005 11:09 pm
Posts: 3669
Location: Italy
Independently by all the proclamations about the future, unicode, and the alien civilizations we will meet thanks to it, it's evident a compiler supporting both ascii and unicode compilation is better than one only supporting unicode.

The one with unicode has a compilation mode less.

It's not a question of future, globalization or whatever. Who cares when you are looking at the two different compilers ?

One offers a feature the other hasn't. And when you need that feature, the one supporting it makes your life easier.

Exactly the same thing for 32 and 64 bit support. "64 bit code is the future", ok, right.
Until there are machines running 32 bit OSes, a compiler offering both is better than the one offering just 64 bits (be prepared for this).

Anyway, the future of PB has been decided, and in unicode mode is still possible to access ascii data in a inconvenient way compared to the pure ascii mode. The time to spoke against it was when this thread started, now does not serve any purpose.
So now you are better off using another compiler (good luck if you want another BASIC), another language or simply to get used to what you have now hoping this decision will result in a positive tradeoff instead of a simple menomation.

And yes, propose ideas to mitigate all this in Features Requests if you have any.

_________________
Philosophy is questions that may never be answered. Religion is answers that must never be questioned.

[ My little PureBasic review ]


Top
 Profile  
Reply with quote  
 Post subject: Re: Removing 'ASCII' switch from PureBasic
PostPosted: Fri Aug 22, 2014 5:19 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Dec 23, 2009 10:14 pm
Posts: 2760
Location: Boston, MA
I trust you don't interpret my words as whining? I am merely stating the repercussions to me with the loss of a fundamental data type. 2 really, if you count fixed length strings .s{1}.
It's not all bad. I welcome 1 less compiler switch. :)
Back to coding...

_________________
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum


Top
 Profile  
Reply with quote  
 Post subject: Re: Removing 'ASCII' switch from PureBasic
PostPosted: Fri Aug 22, 2014 5:22 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 31, 2005 11:09 pm
Posts: 3669
Location: Italy
skywalk wrote:
I trust you don't interpret my words as whining?


No, I didn't.

_________________
Philosophy is questions that may never be answered. Religion is answers that must never be questioned.

[ My little PureBasic review ]


Top
 Profile  
Reply with quote  
 Post subject: Re: Removing 'ASCII' switch from PureBasic
PostPosted: Fri Aug 22, 2014 5:28 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Dec 23, 2009 10:14 pm
Posts: 2760
Location: Boston, MA
And I learned a new word...menomation. You have a strong vocabulary luis!

_________________
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum


Top
 Profile  
Reply with quote  
 Post subject: Re: Removing 'ASCII' switch from PureBasic
PostPosted: Fri Aug 22, 2014 5:43 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 31, 2005 11:09 pm
Posts: 3669
Location: Italy
skywalk wrote:
You have a strong vocabulary luis!


And when I'll learn to connect them together (the words) in English sentences without making errors I'll be unstoppable.

_________________
Philosophy is questions that may never be answered. Religion is answers that must never be questioned.

[ My little PureBasic review ]


Top
 Profile  
Reply with quote  
 Post subject: Re: Removing 'ASCII' switch from PureBasic
PostPosted: Fri Aug 22, 2014 6:24 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Apr 12, 2013 1:55 pm
Posts: 1058
Location: just outside of Ferguson
menomation
The word you've entered isn't in the dictionary. Click on a spelling suggestion below or try again using the search bar above.


Answers.com: What is menomation?
While reading an article I was presented with the word "menomation" and I had no idea what it meant. Also, I could not find the definition in any of my typical sources. Fortunately, I was able to determine that it was Italian in origin. That lead me to a translator program and found it meant "impairment." In an unfortunate turn, the article was referring to eunuchs at the time.


Comparing the fixing of what ain't broken to a castration was simply brilliant luis!
Perhaps a little dramatic, but nicely done. :lol:

_________________
Keep it BASIC.


Top
 Profile  
Reply with quote  
 Post subject: Re: Removing 'ASCII' switch from PureBasic
PostPosted: Fri Aug 22, 2014 9:35 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Nov 09, 2010 10:15 pm
Posts: 1497
Well, for Luis' sake, let's hope is not impaired in that manner!!!!


Top
 Profile  
Reply with quote  
 Post subject: Re: Removing 'ASCII' switch from PureBasic
PostPosted: Fri Feb 13, 2015 9:37 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat May 17, 2003 11:31 am
Posts: 6045
skywalk wrote:
I trust you don't interpret my words as whining? I am merely stating the repercussions to me with the loss of a fundamental data type. 2 really, if you count fixed length strings .s{1}.
It's not all bad. I welcome 1 less compiler switch. :)
Back to coding...


Oooooouch. This is the one thing I forgot about. Fixed length strings are primarily great for dealing with API's that have fixed length buffers (think about ISDN and telecom related stuff) as part of their structures. Those buffers are typically ASCII (some of that stuff is 20 to 30 years old, think winsock and the like).

Okay, I can POKES() PEEKS() these fields, but that suddenly makes the fixed length type not that useful anymore... Hmrpf. Poor Fred. First I pestered him for the type, and now I probably won't use it much anymore :lol:

_________________
( PB5.xx Win10 x64 Asrock AB350 Pro4 Ryzen 1600X Evo 840 GTX1060 )
( The path to enlightenment and the PureBasic Survival Guide right here... )


Top
 Profile  
Reply with quote  
 Post subject: Re: Removing 'ASCII' switch from PureBasic
PostPosted: Mon Aug 31, 2015 4:53 pm 
Offline
Addict
Addict

Joined: Sat Mar 02, 2013 9:17 am
Posts: 931
I think removing the ASCII switch is not good.

My AES suite QUICK-AES-256 was a lot of work.
She has versions for x86 / x64 / ASCII / UNICODE , Win, Linux -inclusive DLL/SO in all variations.

But the Unicode versions was very prone and very difficult for debugging, a nightmare -LOL

Hmmm, for comparing you can downloading the compete packet here on my website.

http://www.quick-aes-256.de

_________________
http://www.nachtoptik.de


Top
 Profile  
Reply with quote  
 Post subject: Re: Removing 'ASCII' switch from PureBasic
PostPosted: Mon Aug 31, 2015 5:29 pm 
Online
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 13439
Location: France
Sure, but IMHO if you had only unicode to start for, you wouldn't had any issues with it because all the dev/test would have been done with unicode. That's one issue with PB as it is now: you can start with ASCII and then once your project is big want to switch to unicode and you get a lot of trouble especially if you use API. I did the unicode version of the IDE and it wasn't easy to get it back on track as the code source was huge and built for ASCII in mind.


Top
 Profile  
Reply with quote  
 Post subject: Re: Removing 'ASCII' switch from PureBasic
PostPosted: Sun Sep 13, 2015 8:53 am 
Offline
Addict
Addict

Joined: Sat Mar 02, 2013 9:17 am
Posts: 931
Yes, for new projects it does not matter, one can, if required, convert UNICODE easily into ASCII...

_________________
http://www.nachtoptik.de


Top
 Profile  
Reply with quote  
 Post subject: Re: Removing 'ASCII' switch from PureBasic
PostPosted: Tue Oct 06, 2015 9:07 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Jan 12, 2011 3:48 pm
Posts: 182
Location: Serbia
Danilo wrote:
Not if you connect to modern libraries and APIs that support UNICODE directly.
The conversion is only required if you connect to old-style, last-century libs,
that don't support UNICODE.

Unfortunately, that's not true. Many popular libraries still use ascii (for compatibility or architecture purposes). Check libcurl for example.
On the other hand, some libraries use utf8 and you still need to use PeekS for interacting with 'em. I usually end up writing some basic macroses or procedures to perform on-the-fly convertion.

However, it's not a big deal for me and i fully support the decision to drop the ascii support.

_________________
PB examples collection
pb-osx-globalhotkeys
pb-osx-notifications


Top
 Profile  
Reply with quote  
 Post subject: Re: Removing 'ASCII' switch from PureBasic
PostPosted: Tue Oct 06, 2015 9:26 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 04, 2015 7:10 am
Posts: 1673
In a Unicode-only PB world does that mean all Ascii strings need to be AllocateMemory'd? and can we no longer use any string functions on them then?

for example i used this function in a Unicode-compiled exe that needed to pass an Ascii string to a lib, i'm just wondering if i'm doing this right or if there's a better way? thanks
Code:
Procedure.i ToAscii(inbuf$)
  Protected *outbuf = AllocateMemory(Len(inbuf$)+1)
  If *outbuf
    PokeS(*outbuf, inbuf$, -1, #PB_Ascii)
  EndIf
  ProcedureReturn *outbuf
EndProcedure

_________________
Thankyou to all the coders who generously helped & encouraged me in the nearly 2yrs when i was welcome here,
it was a tremendous privilege. I learned a lot. I wish you and your families all the best and success for the future.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 211 posts ]  Go to page Previous  1 ... 11, 12, 13, 14, 15  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: Fred and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye