TSilang 6.0.2, Delphi 7 and Vietnamese
TSilang 6.0.2, Delphi 7 and Vietnamese
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
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
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.
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.
Best regards,
Igor Siticov.
Igor Siticov.
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?
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?
an example
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?
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?
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.
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.
Best regards,
Igor Siticov.
Igor Siticov.
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
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
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?
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?
Best regards,
Igor Siticov.
Igor Siticov.
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.
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.
Best regards,
Igor Siticov.
Igor Siticov.