ah perfect , easy enough, thank you Sven , I learned a ton today.
Definitely will keep in mind. I can have a mix of non Unicode and Unicode
data, so its not a problem per se.

For now I am focused on creating a RPC, which means I will pass strings
that will be interpreted by C++ and translated to Unreal API calls.
Additionally to that I will be passing byte data for regular data, player
lives, game level, ammo, time left etc.

A part of the shared memory could  be Unicode for international text that
will appear in game. My problem was that Windows uses Unicode everywhere
and it also uses data types that are double in size for C++ just to
accommodate Unicode. That creates incompatibilites for the memory model I
am creating that I want to be the same across Windows, Linux and MacOS.

Basically the entire shared memory model will be one huge byte array shared
between Pharo and C++ separated in 3 sections:

Section 1- Header - this is where global data / general information is
stored [standard size]
Section  2- Commands - strings and data to be interpreted by C++ as Unreal
API commands  , 1 command at a time [standard size]
Section 3- Live data- this is data to be stored with the game and describe
the live state of the game itself so the player can carry on from where it
exited the game without any need to save.


On Mon, Nov 21, 2016 at 2:48 PM Sven Van Caekenberghe <[email protected]> wrote:

>
> > On 21 Nov 2016, at 13:35, Dimitris Chloupis <[email protected]>
> wrote:
> >
> > " reality check...
> > http://utf8everywhere.org/
> >
> > Sorry I don't remember enough of my Unicode research six months ago to
> > be more help.
> > Only enough to know there are traps and hunt down that article.
> >
> > cheers -ben"
> >
> > Really .... ???
> >
> > So bad ???
> >
> > Oh well good thing I did not intend to use Unicode. Very eye opening
> article thanks.
> >
> > "First read the general introduction
> >
> >
> https://ci.inria.fr/pharo-contribution/job/EnterprisePharoBook/lastSuccessfulBuild/artifact/book-result/Zinc-Encoding-Meta/Zinc-Encoding-Meta.html
> >
> > That should be more than enough (we got all basic covered in Pharo).
> >
> > If you want more, there is the Pharo Unicode project
> >
> >
> https://medium.com/concerning-pharo/an-implementation-of-unicode-normalization-7c6719068f43
> >
> > But you most probably don't need that.
> >
> > I thought that Windows used UTF-16 internally
> >
> >  https://en.wikipedia.org/wiki/UTF-16#Usage";
> >
> > Yes Windoom uses UTF-16, I am amazed how the coding world managed to
> take another simple problem and make it so complex.
> >
> > In any case , I dont need Unicode . I made the decision to just chain
> string characters  together in 2 byte unicode arrays , I wont be converting
> from or to Unicode anyway. For usual English characters the second byte of
> a Unicode character array on Win 10 is always 00 which is a waste of memory
> anyway.
> >
> > Unicode may come handy when I have to deal with translating the game to
> other languages , but this for now is a very low priority.
> >
> > As always I love your medium posts, clear, simple and to the point.
> Definitely bookmarked for future reference. Thanks
>
> You might as well use the real thing (and then you're good for the future
> too):
>
> ZnUTF16Encoder new encodeString: 'Ελλάδα'. "#[3 149 3 187 3 187 3 172 3
> 180 3 177]"
> ZnUTF16Encoder new encodeString: 'Greece'. "#[0 71 0 114 0 101 0 101 0 99
> 0 101]"
>
> ZnUTF16Encoder new decodeBytes: #[3 149 3 187 3 187 3 172 3 180 3 177].
> "'Ελλάδα'"
> ZnUTF16Encoder new decodeBytes: #[0 71 0 114 0 101 0 101 0 99 0 101].
> "'Greece'"
>
> Good luck with your coding.
>
> Sven
>
>
>
>

Reply via email to