PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Convert Text to Unicode
Convert Text to Unicode
Iniciado por guest, 03,mar. 2018 13:36 - 8 respuestas
Publicado el 03,marzo 2018 - 13:36
This is probably an obvious question but it is two fold:

1. All Strings/Memo fields in m y Analysis and declared in the Project are Text. If I change these to Unicode in the Analysis and Project and recompile, will EXISTING data be affected at all?
2. If Unicode is so good (which it is), why is this not the default text Type?

Q2 would indicate to me that they are in fact different types in respect of the data and why I wonder what effect the conversion would have on the data.

Thx
Publicado el 03,marzo 2018 - 14:07
Hi John,

1. I didn't test, but I suspect that it would be transformed in unicode, as, up till now, each time I changed a type of variable, data was converted automatically to new type, if at all possible.

2.a) Historical reasons... The analysis tool existed before unicode became a fad, and you just don't change your defaults in an application used by 10s of thousands of people without a very good reason
b) you are saying that unicode is good. Personally, I do not code in terms of good or bad, but in term of USEFUL FOR A SPECIFIC PROJECT OR NOT... So, if, like MOST of WXUsers, you are working only in latin based languages, then you don't NEED unicode, and you probably don't want to use unicode just to double the size of all your strings in memory and on disk.
c) I'm not working at pcsoft, but it seems to me that the majority of WX developer use windev for windows, then some use webdev and some mobile... windows and the web are mostly ANSI based, and Mobile is the only environment where unicode is the norm... and it's only used by a minority of wx user... So there is NO reason to change the default type of strings.

Best regards
Publicado el 03,marzo 2018 - 14:14
Thx Fabrice. I have to be different

My MAIN development is in Mobile. However since asking the question this subject has become somewhat academic. I am just playing around trying to get data into a memo field and came across a situation where the data was in binary format (an image). When you add that to the Memo it does not store it correctly and anything added to the same field is trashed.

I was just wondering about trying Unicode or UTF and then realized I was being an idiot and getting carried away! You cannot put binary data into anything other than a binary field.

Most people I come across store images using a link to an image on the device. That is very dangerous IMHO and I embed all images into a binary field. Especially when moving data around devices.
Publicado el 03,marzo 2018 - 14:37
Hi John,

1. The last time I changed an Analysis to use Unicode Strings (and text), wdmodfic, did NOT do a good job with the existing data - to say things politely ...
My strings, texts etc in the data files ended up as "garbage".
But note that I tested on ANSI GREEK character tables/files - things may be different with ENGLISH or other WEST EUROPEAN/LATIN data.
I think it was with WD v19 - didn't test on newer wdmodfic versions.

2. As Fabrice said, probably for historical reasons and that most developers target ANSI/LATIN users.

I have since moved ALL my new development to UNICODE - makes things a LOT easier if you want to support international users (in the same app) and move smoothly between WD, WEBDEV and WINDEV Mobile.
Don't forget to make your apps (configuration) UNICODE also ...


Regards
Steven Sitas
www.alpha360.biz
Publicado el 03,marzo 2018 - 14:46
Thx Steven. I am at a crossroads. As Fabrice says it swells the data somewhat so am a bit wary of that. Also if I come across a Chinese User for example then I would need Unicode. But am I going to get a Chinese User? I market worldwide but so far no Chinese uptake. Although I have had Indian enquiries but am very wary of those as they seem "suspicious".

But if there is any chance of screwing with the data then I think as Fabrice says I would steer clear of it.

I only have a handful of Clients currently using this particular app (WB, WD, WM replicating) but as they have existing data it is a bit worrysome.

So conclusion is I will test with English data which is all I have now and see how it goes. Then worry about it.
Publicado el 03,marzo 2018 - 15:39
Hi John

regarding storing of images in a DB: that's what the binary memo field is for.

As for TRANSPORTING binary data between mobile and server, you can do it with httprequest in post mode directly, or you can transform into a base64 string before transfer.

You can also store an image into a memo text by encoding it in base64 (doing that in wxreplication)

Best regards
Publicado el 03,marzo 2018 - 15:57
Hi

I've been using unicode projects with wx22 seamlessly and it's a good go and
minimum job is to create a completely new analysis with unicode and
of best transferring old analysis data into new one to avoid any conflicts and
perhaps it is extra service charge to customer for now and future development.

Once you click on new unicode project analysis, it's free for any languages being
applied/stored in your app under wx.

HTH

King
Publicado el 04,marzo 2018 - 10:17
One last thing comes to mind regarding unicode + iOS, as you are in this situation...

While unicode is supported, not all subtype of unicode keys are supported in iOS (or at least WERE, when I was working on the WXreplication iOS version)... I had to change the sub type to something like universal or standard to make it work.

However, that was in WX19 or 20, so that may have changed since.

Best regards
Publicado el 04,marzo 2018 - 10:28
Thx Fabrice. I am giving up on this mini project I am doing.

I am not going to pay an upgrade fee just to get the reported functionality "is record" in WM (iOS). Using HCopyRec and HAlias is very slow by comparison and there is a noticeable delay now between Android/Windows and iOS.

If that is the case then changing to Unicode makes no sense at all as it will only be used in this mini project.

With all dues respect Fabrice the idea of working on the least supported product makes no sense to me. I have suggested many features for iOS but 4 years down the road and PCSoft still have not implemented any feature. They have all been things my Clients would like to see supported.

Also as they do not add features to every platform at one time, iOS is typically 3 years behind WD at least, then had I just developed in iOS I would never have got anywhere

When I update my apps I make sure all the features are available cross platform so to find PCSoft still not doing this is disappointing and stifles development.

In todays environment Users expect a Windows, Android, iOS and Cloud version of your app to be available.

It's no big deal for me anyway, I was just filling in time between projects. But thx for the advice anyway. It's never wasted just not practical for me in this situation.