Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Unicode UTF-8 strings handling

Author
Message
Scary Little Rabbit
14
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 14th Sep 2016 16:12 Edited at: 16th Dec 2016 09:08
OK, since AppGameKit is working on Ubuntu again:



gist.

if you want to get any of your strings to the screen try text functions from txtUTF8.agc.

there is an example project in attached archive.

have fun. NO FUN ANYMOREthat's all, folks!
error #1:
'too many stars, too many stares. disembody.'
Unicode yours

Attachments

Login to view attachments
Scary Little Rabbit
14
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 22nd Sep 2016 20:57
* code was rewritten to speed runtime up a bit (it's about 40% faster now)
* a tabulation was added to initially generated list of chars
* getUTF8() was rewritten and uncommented (it's like asc(), but returns 63 in case if char is unknown (need to polish))
error #1:
'too many stars, too many stares. disembody.'
Unicode yours
Scary Little Rabbit
14
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 1st Oct 2016 12:41
* there is no more need for a file with predefined list of UTF-8 chars to use
error #1:
'too many stars, too many stares. disembody.'
Unicode yours
jamesB
7
Years of Service
User Offline
Joined: 2nd Sep 2016
Location:
Posted: 9th Oct 2016 13:26
Thanks a lot, very helpful.

How can I use this to create Russian text using CreateText() which I can display on the screen (i.e. not in a file)?
Scary Little Rabbit
14
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 10th Oct 2016 07:10 Edited at: 20th Oct 2016 20:08
jamesB, you need a font image with cyrillic chars loaded, setTextExtendedFontImage() command applied with that image index number passed to it for your text objects (or setTextDefaultExtendedFontImage() for all by default) and some function to map Unicode chars to ASCII ones, like this one:



e.g.


UPD

nah, try this instead. you still need some font image with well prepared 'subimages.txt' though.
error #1:
'too many stars, too many stares. disembody.'
Unicode yours
Alex_Peres
AGK Master
14
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 10th Oct 2016 12:28
Where have you been three month ago...

Спасибо бро!
Scary Little Rabbit
14
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 10th Oct 2016 13:13 Edited at: 10th Oct 2016 13:14
Alex_Peres, and where have you been? I was here complaining about the issue and suggesting some crazy things.

на здоровье.
error #1:
'too many stars, too many stares. disembody.'
Unicode yours
Alex_Peres
AGK Master
14
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 10th Oct 2016 15:58
I've made my own font system which is working on every language(even chinese) and every platform!
But it's for tier2...
Scary Little Rabbit
14
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 20th Oct 2016 08:34
* critical bug in chars' parsing was fixed
error #1:
'too many stars, too many stares. disembody.'
Unicode yours
Scary Little Rabbit
14
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 20th Oct 2016 20:04
Alex_Peres, OK, I've made something similar too, for Tier 1.
error #1:
'too many stars, too many stares. disembody.'
Unicode yours
Scary Little Rabbit
14
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 16th Dec 2016 09:00
OK, it's obsolete since version 2.0.22 is out with built-in support of UTF-8. and more over — the code is broken because len() returns correct value of string chars now: the value of 'sl' is to low in strUni() and app is going to crash when it executes setMemblockString(_strMemblock, 0, s) at line #80. I see no reason to fix it, all you need is an upgrade to version 2.0.22.
error #1:
'too many stars, too many stares. disembody.'
Unicode yours
Jack
19
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 16th Dec 2016 11:47
Even when 2.0.22 is released with UTF8 support,
I want still thank you Scary Little Rabbit for your efforts! You did a great job.

[/url]
Scary Little Rabbit
14
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 16th Dec 2016 11:50
Jack, you're welcome.
error #1:
'too many stars, too many stares. disembody.'
Unicode yours

Login to post a reply

Server time is: 2024-03-19 08:44:30
Your offset time is: 2024-03-19 08:44:30