ASCII 8 bits vs UNICODE

Working on new editor enhancements?
AMpos
Enthusiast
Enthusiast
Posts: 131
Joined: Fri Jun 05, 2020 12:47 am

ASCII 8 bits vs UNICODE

Post by AMpos »

Hi!

I have a program, writen 3 years ago.

Now I have to make some changes and it is messing by database. It recorded items a BYTE ASCII and now it is using UNICODE.

Is there a way to tell the compiler to use the old BYTE ASCII system?

If not, is there a way to force all readstring and writestring to use the BYTE mode (like #PB_Ascii, chatgpt hint)?

(I would not like to use this method, since I have to find and modify all the readstring and writestring, with the posibility to miss some ones)
User avatar
minimy
Enthusiast
Enthusiast
Posts: 739
Joined: Mon Jul 08, 2013 8:43 pm
Location: off world

Re: ASCII 8 bits vs UNICODE

Post by minimy »

Code: Select all

OpenFile(0,"Test",#PB_Ascii)
WriteString(0,"Hello",#PB_Ascii)
If translation=Error: reply="Sorry, Im Spanish": Endif
AMpos
Enthusiast
Enthusiast
Posts: 131
Joined: Fri Jun 05, 2020 12:47 am

Re: ASCII 8 bits vs UNICODE

Post by AMpos »

I know. I just dont want to search for all the readstring / writestring and add the #PB_Ascii, I could skip one and mess it even more.
User avatar
mk-soft
Always Here
Always Here
Posts: 6404
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: ASCII 8 bits vs UNICODE

Post by mk-soft »

Default is UTF8. Only Open- Create- Read- File must be set to ASCII.
Not Read- or WriteString ...
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
AMpos
Enthusiast
Enthusiast
Posts: 131
Joined: Fri Jun 05, 2020 12:47 am

Re: ASCII 8 bits vs UNICODE

Post by AMpos »

Thx!
juror
Enthusiast
Enthusiast
Posts: 246
Joined: Mon Jul 09, 2007 4:47 pm
Location: Courthouse

Re: ASCII 8 bits vs UNICODE

Post by juror »

Compiler options can also effect a change in how sqlite text is interpreted
User avatar
skywalk
Addict
Addict
Posts: 4260
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: ASCII 8 bits vs UNICODE

Post by skywalk »

Good to know.
I've been relying on the default state. :oops:
Run query: 'PRAGMA encoding;'
Returns: 'UTF-8'
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Post Reply