Integrated Application Platform › Forums › General › [SOLVED]Browse control unicode language displaying issue
- This topic has 7 replies, 3 voices, and was last updated 9 years, 1 month ago by
jaska_lee.
-
AuthorPosts
-
August 1, 2014 at 5:13 am #778
jaska_lee
ParticipantGreetings to Andrew and the rest of suneido community,
I am located in Southeast Asia and recently I have spent quite some time playing around with suneido development environment for a possible project. I must say that the development environment (so much the whole concept behind of it) is very impressive. It is very close to what I was looking for as an alternative to another proprietary ERP system that I have been working on for nearly 10 years.
While I was trying to play around with suneido environment, I found there is a small issue related to asian text displaying, particularly on browse control. Currently, I use Thai language to store and display texts. What I did :
1) Knowing that suneido is not unicode compatible, I changed the windows language as ‘Thai’ for non-unicode program support under Windows –>Region & Language –> Administrative –> Language for non-Unicode programs. I am using Windows 7 Ultimate (64bit).
2) I exceuted Suneido.Language = #(name: “thai”, charset: “THAI”, dict: “th_TH”). The Thai language charset is available in standard CHARSET object.
3) I then created a table, a card form(Access control) base on the table and a list form(Browse control) based on the same table.
4) I input some Thai language texts in the field on Access control. Everything works fine for both input and output.
5) But when I run the list form(browse control), the same Thai language text is displayed as some kind of messed strings in uneditable mode. But as soon as I try to edit the text in editable mode, it displays it correctly with original texts.
I tried to dig into the browse control and find out what can be done to correct it but no luck. I also tried to compare the way how Access control is displaying texts in order to correct the browse control but no luck either. I must admit that i have no experience with C++.
Could anybody here give a hand on this? I have attached some screenshots to better explain the situation.
Again, impressive work to suneido and keep up the great work 😉
Cheers,
JaskaAugust 3, 2014 at 2:01 pm #1061jaska_lee
ParticipantI have found something more interesting.
If I change the Windows OS language code page setup to be Chinese or Korean in the same way I did for Thai, this problem does not exist. Both access and browse controls worked fine. What is interesting is that all of them are typical unicode languages but Thai behaves differently than the other two in suneido client.
The code in suneido that initializes data for browse is called “.list.set(data)”. Unfortunately, I couldn’t go any further as the behavior seems to be defined in c++.
I tried to hard code a specific font for certain columns. But it brings up other compatibility issues.Does anybody have any suggestion what could be done next?
Thanks a lot
August 5, 2014 at 3:05 pm #1062jaska_lee
ParticipantFor those who might find it useful, it turned out to be a specific font issue. The problem is resolved by changing the font name in class “StdFonts” which is used during runtime.
Ui()
{
return OSVersion() < OSVersion.VISTA ? "Tahoma" : "AngsanaUPC"
}Since I am using Windows 7 (64bit), “AngsanaUPC” is what is returned and used. But this change also affects everything else across the whole interface which is not what I want. They are still readable but barely. Could I define font per column?
August 6, 2014 at 6:18 am #1063jaska_lee
ParticipantI was a bit confused with the way how font is specified for field and that took quite a while to figure it out. The final solution is
adding the following font definition into field formatFormat: (Text, width: 20,font: #(name: "AngsanaUPC", size: 11))
I assume it will affect everywhere this field is being shown. Still, I haven’t found a way to defined font per column.
It would be a lot better to use some sort of UI tool to simply this kind of things.
August 11, 2014 at 7:37 pm #1064j_ferguson
ModeratorYou should be able to define a class with the column name in the name like this
Field_YOURCOLUMNNAMEHERE
and the definition can look like this:
Field_string // or whatever datadict definition you want to inherit from
{
Format: (Text ….)
}August 12, 2014 at 12:07 pm #1065jaska_lee
Participantj_ferguson: Thanks for your suggestions, that’s what I eventually discovered.
The minor issue with this approach is that it changes the font of that field universally. The initial problem only existed on browse control. Everywhere else, it was as good as it could be. After making this change, while it fixed the browse displaying issue, it also changed the default font in all other places which is not as nice as it use to be. Not such a big deal and I guess i can live with it.
Thanks for your help indeed.
August 14, 2014 at 4:24 pm #1066amckinlay
KeymasterBrowseControl (actually ListControl that it inherits from) displays columns using code related to the report code. (It’s not in the C++ code – all the GUI code is in stdlib.) So one thing to try would be to check whether reports show the text properly. The related code is in TextFormat.
I can not think of any “easy” way to change the font just for Browse. This would need to be handled in the report / format code.
Sorry for the problems. Because we only use English, the foreign language support is not as well tested. It has mostly been developed and debugged by other contributors.
August 15, 2014 at 12:52 am #1067jaska_lee
ParticipantHi Andrew, j_ferguson
Thanks for your help. In my experience working with other non-Unicode program which is used in different countries, there were still issues related to Asian language support even after 30 years since it was born. It is often not on the application level but OS code page setup and font design level. Sometimes, it is limited to what one can do on the application level(unless enabling unicode support, but it’s not what I want as it does what what i need). So I am kind of prepared.
I am surprised how far suneido has got in terms of Asian language support in my first attempt.
So far, it does everything I need.
No complaints at all :). -
AuthorPosts
- You must be logged in to reply to this topic.