ASCII Deprecation

Just starting out? Need help? Post your questions and find answers here.
ANDY ANDERSON
User
User
Posts: 62
Joined: Thu Aug 28, 2014 9:02 pm

ASCII Deprecation

Post by ANDY ANDERSON »

Maybe one of the top fellows will answer this.

When ASCII support is deprecated, does that mean that one will not be able to
read or write ASCII to or from files ?

If so, there may be a problem. I write specialized accounting applications
having to do with U.S. government billing such as Medicare and Medicaid.
The HIPAA 5010 required standard is ASCII for data files sent or received.

So am I out of luck ?

Thanks in advance.
User avatar
helpy
Enthusiast
Enthusiast
Posts: 552
Joined: Sat Jun 28, 2003 12:01 am

Re: ASCII Deprecation

Post by helpy »

See blog post of freak: http://www.purebasic.fr/blog/?p=452
Windows 10 / Windows 7
PB Last Final / Last Beta Testing
ElementE
Enthusiast
Enthusiast
Posts: 139
Joined: Sun Feb 22, 2015 2:33 am

Re: ASCII Deprecation

Post by ElementE »

ANDY ANDERSON wrote:When ASCII support is deprecated, does that mean that one will not be able to
read or write ASCII to or from files ?
The PB functions ReadString and WriteString both have optional format flags that let you specify the format (Ascii, UTF-8, Unicode) of the data to be read or written.
Think Unicode!
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: ASCII Deprecation

Post by Keya »

seeing as its nearly Christmas, is there a "Using Ascii strings from Unicode-compiled PB apps" guide?!? that would help make the Ascii->Unicode transition less scary :)
ANDY ANDERSON
User
User
Posts: 62
Joined: Thu Aug 28, 2014 9:02 pm

Re: ASCII Deprecation

Post by ANDY ANDERSON »

@ElementE

I am aware of the ReadString, WriteString and various file open commands with
the #PB_Ascii flag.

The question is whether this flag will be supported in the releases after ASCII
deprecation.
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: ASCII Deprecation

Post by skywalk »

Briefly, the deprecation is Ascii compile. Meaning, native strings will be Unicode.
The commands will still support the #PB_Ascii switch and there will be additional functions for ToAscii(), ToUni(), etc.
But, if you read file contents using #PB_Ascii switch and assign to a PB string variable, it will now be a Unicode string.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: ASCII Deprecation

Post by IdeasVacuum »

The flags will indeed continue to be supported. Fred's post:
http://www.purebasic.fr/english/viewtop ... 14&t=60171
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
helpy
Enthusiast
Enthusiast
Posts: 552
Joined: Sat Jun 28, 2003 12:01 am

Re: ASCII Deprecation

Post by helpy »

As you can read in the blog post:
...

So we decided to remove the ability to compile in ascii mode in the PB version that follows after the next LTS version (that is, the LTS version coming after the 5.2x LTS cycle ends).

...

No changes will be made to the language or data types (The .c, .a and .u as well as the pseudo-types and library commands will remain as they are). The only difference is that the “compile in unicode mode” switch in the compiler will be permanently set to “on”.

...
Windows 10 / Windows 7
PB Last Final / Last Beta Testing
ANDY ANDERSON
User
User
Posts: 62
Joined: Thu Aug 28, 2014 9:02 pm

Re: ASCII Deprecation

Post by ANDY ANDERSON »

@skywalk, IdeasVacuum and helpy

Thanks, I feel better now. I'm 72 years old and plan to retire at 75.
So 64 bit ASCII will probably carry me through.

But if for some stupid reason, I decide to continue coding to senility,
the functions you mentioned will provide a work around when 128 bits
becomes the norm.

Thanks, again.
ElementE
Enthusiast
Enthusiast
Posts: 139
Joined: Sun Feb 22, 2015 2:33 am

Re: ASCII Deprecation

Post by ElementE »

Fred gave the practical implications of the change when he wrote the following:
  • - Basically, if your software runs with the "unicode" swith ON, nothing will change, you can skip the following text :). If not, then you can enable it and test it.
    - All strings in PB will be handled as UCS2 (16-bit) strings internally. So if you used "@String$" somewhere in your code, change are high it won't work anymore (if dealing which an API for example)
    - We plan to provide 2 new functions, to ease things a bit:
    *AsciiBuffer = ToAscii(String$)
    *UTF8Buffer = ToUTF8(String$)
So if we get our programs all tested and working now in Unicode Mode, we should be safe.
Think Unicode!
Post Reply