Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AbrahamR, AndrewAMD), 1,305 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Unicode: str_createw(short* s) #398074
03/27/12 13:10
03/27/12 13:10
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline OP

Programmer
Lukas  Offline OP

Programmer

Joined: May 2007
Posts: 2,043
Germany
I think it was already a long time ago that you implemented Unicode support for Gamestudio, but only recently I looked at how this Unicode support actually works.

The manual says, I'm supposed to write my strings in a text file and read them with txt_loadw. WTF? I can't write Unicode strings at runtime and without having all my strings preset in a text file, and open to everyone?

So, I would like to have a function str_createw(short* s).
It would use short, because wchar_t doesn't exist in Lite-C, but short is basically the same anyway.

This way, I could create a Unicode string like this:

Code:
short shortarray[6];
shortarray[0] = 0x3053;
shortarray[1] = 0x3093;
shortarray[2] = 0x306B;
shortarray[3] = 0x3061;
shortarray[4] = 0x306F;
shortarray[5] = 0x0000;

STRING* mystring = str_createw(stringarray); // mystring now contains "konnichiwa" in Japanese Hiragana


The string would then be "こんにちは".

That wouldn't be hard to implement, would it? wink


EDIT: Oh, and of course, there should also be a function _short(STRING* s) that returns a short array for a string, just like _chr(STRING*) returns a char array for "normal" strings.

Last edited by Lukas; 03/27/12 13:22.
Re: Unicode: str_createw(short* s) [Re: Lukas] #398075
03/27/12 14:12
03/27/12 14:12
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline
Serious User
Rackscha  Offline
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
Mh test it out, but if i remember correctly, generated strings are unicode.

I remember when they introduced Unicode, ANet/GSTNet crashed.
I used runtime strings. A7 generated Unicode strings and Anet/GSTNet required still ascii strings->BOOM.

So i think, runtime strings are Unicodestrings.

Last edited by Rackscha; 03/27/12 14:16.

MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: Unicode: str_createw(short* s) [Re: Rackscha] #398078
03/27/12 14:32
03/27/12 14:32
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline OP

Programmer
Lukas  Offline OP

Programmer

Joined: May 2007
Posts: 2,043
Germany
Really? But even if that's the case, I can still only create ASCII characters in runtime strings, because they are created with char arrays, not with wchart_t or short arrays.

Re: Unicode: str_createw(short* s) [Re: Lukas] #398209
03/29/12 14:11
03/29/12 14:11
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
+1 On this request!
Doing Unicode processing and string generation at runtime isn't that hard, whats really hard is to force it into an STRING object.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Unicode: str_createw(short* s) [Re: WretchedSid] #398485
04/02/12 17:07
04/02/12 17:07
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline OP

Programmer
Lukas  Offline OP

Programmer

Joined: May 2007
Posts: 2,043
Germany
Bump.

Re: Unicode: str_createw(short* s) [Re: Lukas] #398777
04/06/12 15:11
04/06/12 15:11
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Ok, we'll implement Unicode string generation from a short* pointer.

Re: Unicode: str_createw(short* s) [Re: jcl] #398780
04/06/12 15:13
04/06/12 15:13
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline OP

Programmer
Lukas  Offline OP

Programmer

Joined: May 2007
Posts: 2,043
Germany
Thanks! laugh

Re: Unicode: str_createw(short* s) [Re: Lukas] #439520
04/04/14 10:55
04/04/14 10:55
Joined: Apr 2014
Posts: 1
Japan
K
k2k Offline
Guest
k2k  Offline
Guest
K

Joined: Apr 2014
Posts: 1
Japan
draw_text(mystring);

---
it's fine! thanks a lot everyone.


Moderated by  aztec, Spirit 

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