Hello!
I have prolems with mui.createobject and german umlauts (I think, the problem will occur with other languages special letters,too).
As an exmple I take your MUI-Royale Example Dynamic1.hws
I replaced the wort "two" in line 7 of dynamic.xml to "zwö".
When I now display Dynamic1.hws, It will start correctly,as the gui will be opened with mui.creategui.
But when I click on "Newwindow", I will get an error message:
Error parsing XML: not well-formed (invalid token) (Line: 7)
File Dynamic1.hws (current line: 76 - In Function: CreateObject)
A Bug??
Merry Christmas!
George
mui.CreateObject and umlauts
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: mui.CreateObject and umlauts
No, it's not a bug. If you don't specify an encoding, XML will fall back to UTF-8 and "ö" is not a valid UTF-8 character, thus causing an error. So you either have to pass the correct UTF-8 code for "ö" or simply set the encoding to ISO 8859-1 by always starting your XML declarations with the following header:
Then it will work fine.
Code: Select all
<?xml version="1.0" encoding="iso-8859-1"?>
Re: mui.CreateObject and umlauts
Okay.
My program will be localised.
It creates the xml-file in realtime while startup up.
That means, Artbase creates a new file and uses 1000s of WriteLine() to write a complete XML-file.
( there were other problems, which treated me to do it this way...).
This file contains the localised strings (about 350) for each supported language.
For german, I could use 8859-1. Does this encoding also run for polish chars (8859-2)??
If not, is there a workaround?
Would it be better, to change those strings later (after creation) with mui.set (id,contents)??
How would this work with "shorthelp"-strings?
Is there any other way to localise xml-files
Regars
George
My program will be localised.
It creates the xml-file in realtime while startup up.
That means, Artbase creates a new file and uses 1000s of WriteLine() to write a complete XML-file.
( there were other problems, which treated me to do it this way...).
This file contains the localised strings (about 350) for each supported language.
For german, I could use 8859-1. Does this encoding also run for polish chars (8859-2)??
If not, is there a workaround?
Would it be better, to change those strings later (after creation) with mui.set (id,contents)??
How would this work with "shorthelp"-strings?
Is there any other way to localise xml-files
Regars
George
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: mui.CreateObject and umlauts
You don't have to use a file for this. You can just create it in a string and then pass this string to mui.CreateObject(). Many people wrongly assume that the XML definition has to be external because all my examples do it that way. But it's perfectly ok to create them in a string.evil wrote:It creates the xml-file in realtime while startup up.
That means, Artbase creates a new file and uses 1000s of Writeline() to write a complete XML-file.
( there were other problems, which treated me to do it this way...).
No, MUI Royale only supports ISO 8859-1 and UTF-8 in its XML files. So if you need Eastern European characters, you have to use UTF-8.This file contains the localised strings (about 350) for each supported language.
For german, I could use 8859-1. Does this encoding also run for polish chars (8859-2)??
If not, is there a workaround?
Changing the strings at runtime can be problematic because AFAIK MUI always uses the system's default charset and there's currently no way of passing UTF-8 to MUI directly. That's why you are better of doing as much as possible at creation time.Would it be better, to change those strings later (after creation) with mui.set (id,contents)??
How would this work with "shorthelp"-strings?
Re: mui.CreateObject and umlauts
I know, but the whole xml-file is about 400kb in size. Its easier for me to put it into a file, first.You don't have to use a file for this. You can just create it in a string and then pass this string to mui.CreateObject(). Many people wrongly assume that the XML definition has to be external because all my examples do it that way. But it's perfectly ok to create them in a string.
Also as it is localised, it would get more comples when adding hundreds of "..cat$[x].." into the string...
So I use ISO 8859-1 at the moment. My polish translator uses 8859-2 for cataloging. Does he see the correct letters inside ArtBase then??No, MUI Royale only supports ISO 8859-1 and UTF-8 in its XML files. So if you need Eastern European characters, you have to use UTF-8.
Or are those "polish-specific" letters displayed wrong on his system???
Ok. So I will do it the standard way... as before....Changing the strings at runtime can be problematic because AFAIK MUI always uses the system's default charset and there's currently no way of passing UTF-8 to MUI directly. That's why you are better of doing as much as possible at creation time.
Thanx!
George
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: mui.CreateObject and umlauts
Yes, he should. He should provide the translated texts as UTF-8 and then you include them in an XML that uses UTF-8 encoding. Then everything should be displayed correctly on Polish systems (but not on your machine since your machine uses ISO 8859-1.... but you can test it on your machine, too, by simply switching language and charset to Polish temporarily).So I use ISO 8859-1 at the moment. My polish translator uses 8859-2 for cataloging. Does he see the correct letters inside ArtBase then??
Or are those "polish-specific" letters displayed wrong on his system???
Re: mui.CreateObject and umlauts
Quite confusing at all...
Well, I will let him test the actual version and we will see....
Thanx for explanation!!
Best regards
George
Well, I will let him test the actual version and we will see....
Thanx for explanation!!
Best regards
George