Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (degenerate_762), 1,098 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
str_printf and Unicode? #462750
10/25/16 05:33
10/25/16 05:33
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
The beta features page says:
Quote:
The str_printf function now also supports Unicode.

Does it really? When I use str_printf on a Unicode string it just results in a scrambled mess of chinese/ whatever symbols. Is there something I am missing?
(As a workaround I can obviously call str_printf on a regular ASCII string, then copy that into the Unicode string in question.)


EDIT: Oh and what are the (undocumented) (Unicode) STRING flags?
I assume (1<<3) and (1<<7) are something like "string is modified", and (1<<6) is the "string is in Unicode" bit? And where is the short array saved, in a different internal buffer?
I have a text object and a string which I use to draw most of my UI stuff with draw_obj. Can I reset the text's string's Unicode bit manually (let's say before the next str_cpy with an ASCII source string) or would that lead to a memory leak?
(Flag 6 is still set after str_printf but you can draw the text with the chars pointer - which you shouldn't be able to with Unicode, right?)

Last edited by Superku; 10/25/16 06:45.

"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: str_printf and Unicode? [Re: Superku] #462840
10/31/16 12:48
10/31/16 12:48
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
str_printf indeed supports no Unicode yet. That beta feature was a little premature - the next version will support Unicode for str_printf, but not the current version.

Here are all flag definitions for strings:

const long STRF_CHANGED = (1<<0); // String was modified
const long STRF_NOWIO = (1<<1); // String is edited with INKEY
const long STRF_SYS = (1<<2); // system string / don't deallocate
const long STRF_NCRLF = (1<<3); // Crlf Count yet to be done
const long STRF_NSAVE = (1<<5); // Don't save this string
const long STRF_UNICODE = (1<<6); // String contains 16-bit characters
const long STRF_NOHASH = (1<<7); // Ignore '#'




Re: str_printf and Unicode? [Re: jcl] #462843
10/31/16 16:15
10/31/16 16:15
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Ok, thanks for the response and information!


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends

Moderated by  old_bill, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1