SiComponents Home Page SiComponents Forums
Here you will be able to get help and share your experience
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TSilang 6.0.2, Delphi 7 and Vietnamese
Goto page 1, 2  Next
 
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite
View previous topic :: View next topic  
Author Message
amos



Joined: 28 Apr 2011
Posts: 13

PostPosted: Thu May 05, 2011 3:46 pm    Post subject: TSilang 6.0.2, Delphi 7 and Vietnamese Reply with quote

Hi

We are trying to see Vietnamese using Delphi 7. We changed the regional options to Vietnamese, received a .sil file containing Vietnamese words and opened it in the SilEditor and the Vietnamese was visible as expected.

The problem was when we loaded the file into our application, once we did that, the captions were in Gibberish instead of Vietnamese. In the forum we saw some posts about this problem with the sileditor but no matter what we tried to do, we didn't see Vietnamese once we imported it into delphi (in SilEditor it's ok)

please advice
thanks
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2103

PostPosted: Fri May 06, 2011 3:20 am    Post subject: Reply with quote

Hello,

Delphi 7 VCL is ANSI but Vietnamese is Unicode language. In order to perform the conversion from Unicode to ANSI and vice versa it is necessary to have Charset information. Unfortunately Delphi 7 doesn't have any charset defined that will support Vietnamese. The only option I would try is the following:
1. Set regional options to Vietnamese as well as Language forn Non-Unicode programs.
2. Use DEFAULT_CHARSET as a charset for Vietnamese.
3. Store SIL file as Ansi not as UTF-8
4. And then to try to load it into Delphi. This will enforce Delphi to use default locale to perform the characters conversion and might work.
Back to top
View user's profile Send private message
amos



Joined: 28 Apr 2011
Posts: 13

PostPosted: Sun May 08, 2011 8:00 am    Post subject: Reply with quote

Thank you for your reply.

The thing is that even in SIL editor itself, when working on a computer with Vietnamese location/language for non-unicode etc, the text became ? instead the Vietnamese characters after saving the file. The only way we could save and see Vietnamese was by changing the file to UTF8.

So now that the file was UTF8 and we saw Vietnamese we import it into Delphi but fail for the mentioned reason.

If I understood you correctly, you say that Delphi 7 does not support Vietnamese specifically as it doesn't have the right charset for it?
Back to top
View user's profile Send private message
amos



Joined: 28 Apr 2011
Posts: 13

PostPosted: Sun May 08, 2011 9:24 am    Post subject: an example Reply with quote

This is what I have in SilEditor:
tiếng Việt

This is what I have after importing to Delphi
tiếng Việt

The above is when the file is UTF8, when working in ANSI, the unicode characters become "?" when moving to another section and then back to "captions" or when saving the file, meaning I have to work in UTF8 mode.

It could be that the problem is that the "file" inside the app is ANSI while the sil file is UTF8 (as it works only when the file is UTF8). If I paste Vietnamese inside the SIL file, I get Vietnamese, If I paste the same thing inside my app when opening the TsiLang component, I get "?" instead of Vietnamese, I guess the solution could be by converting the TsiLang in my project to UTF8 as well, what do you think?
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2103

PostPosted: Tue May 10, 2011 8:18 am    Post subject: Reply with quote

Hello,

Delphi 7 applications are ANSI and when using Unicode characters it is needed to have a Charset details to perform the conversion. But since there is no Charset defined for Vietnamese language the conversion fails and you get ? chars inplace of the character that failed to convert. I actually think that the ONLY way to be able to work with Vietnamese under Delphi 7 is to set Regional Options to Vietnamese on the PC where Delphi 7 is installed and set DEFAULT_CHARSET for Vietnamese language. Also if you converted the SIL file to UTF-8 please be sure to set StoreAsUTF8 property of TsiLang to True as well before loading the file under IDE.
Hope this helps.
Back to top
View user's profile Send private message
amos



Joined: 28 Apr 2011
Posts: 13

PostPosted: Wed May 11, 2011 8:47 am    Post subject: Reply with quote

Thank you for your reply

We are using TSilang 6.0.2, is there a StoreAsUTF8 property? I couldn't find it

Thanks
Back to top
View user's profile Send private message
amos



Joined: 28 Apr 2011
Posts: 13

PostPosted: Wed May 11, 2011 9:53 am    Post subject: Reply with quote

We downloaded the trial of the latest version and we did see this property, we set it to TRUE and then imported the specific language to the specific form but had the same problem.

The weird part is:
When using the SILEditor (not sure with what delphi version it was compiled) we had to use Convert to UTF8 in order to see the Vietnamese, meaning the SILEditor had the same problem that UTF8 solved, so we wonder why it doesn't work when importing it into the IDE

In order to import, we imported ONLY the Vietnamese and ONLY to that form where the TSILang object was as UTF8 but it didn't work, maybe there is another way to do it? notice that there were other languages for this component that were stored previously without UTF8
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2103

PostPosted: Thu May 12, 2011 4:17 am    Post subject: Reply with quote

SIL Editor is Unicode application and this is why when you store Vietnamese as UTF8 it is able to convert and display it. Since conversion from UTF-8 to Unicode is performed without any additional information.
Delphi 7 is ANSI application as well as its VCL, this is why it will use defined (or default) charset for conversion from Unicode to ANSI.
Did you setup "Language for non-Unicode programs" option to Vietnamese and define Default_Charset from Vietnamese language?
Back to top
View user's profile Send private message
amos



Joined: 28 Apr 2011
Posts: 13

PostPosted: Thu May 12, 2011 7:39 am    Post subject: Reply with quote

Yes, we defined Vietnam and Vietnamese wherever possible in regional settings but we keep getting
tiếng Việt
instead of
tiếng Việt
once we import the SIL file into the IDE

I guess we have no way of seeing Vietnamese with Delphi 7
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2103

PostPosted: Thu May 12, 2011 11:09 am    Post subject: Reply with quote

tiếng Việt
is looking very much like UTF8 text not converted to the actual string.
Back to top
View user's profile Send private message
amos



Joined: 28 Apr 2011
Posts: 13

PostPosted: Thu May 12, 2011 11:48 am    Post subject: Reply with quote

Which either strengthen your point regarding the missing charset or means that we are missing something

It's more likely that your charset theory is the right one
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2103

PostPosted: Thu May 12, 2011 12:22 pm    Post subject: Reply with quote

Please try the following:
1. Create new project
2. Place TsiLang on form and define Vietnamese language there.
3. Set StoreAsUTF8=True.
4. Set Default_Charset for Vietnamese
5. Open Translation Editor and paste into Vietnamese item any value from SIL Editor using Windows clipboard.
6. Save the Translation Editor and open it again.
7. Check the content of Vietnamese.
Back to top
View user's profile Send private message
amos



Joined: 28 Apr 2011
Posts: 13

PostPosted: Thu May 12, 2011 1:01 pm    Post subject: Reply with quote

We tried that already

We either had ? when Vietnamese was not the language of the computer or tiếng Việt when it was...

As you explained, it's as if Delphi fails to do the conversion
Back to top
View user's profile Send private message
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2103

PostPosted: Thu May 12, 2011 5:16 pm    Post subject: Reply with quote

I'm sorry, but are you sure that when you copy using Windows Clipboard tiếng Việt from SIL Editor into Translations Editor you get tiếng Việt
Back to top
View user's profile Send private message
amos



Joined: 28 Apr 2011
Posts: 13

PostPosted: Sun May 15, 2011 9:26 am    Post subject: Reply with quote

Apparently it's even worse
I get ? instead of the characters when pasting, when I load language for Vietnamese I get the tiếng Việt
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by p h p B B  © 2001, 2005 p h p B B  Group