German umlaut

Please report bugs here. If you are unsure whether something is a bug or an expected behavior, please post it on the "Technical Support" forum instead, and wait for a moderator to handle/move the post.
CyborgDE
Posts: 75
Joined: Wed Aug 12, 2015 9:21 pm

German umlaut

Postby CyborgDE » Thu Sep 10, 2015 12:30 am

Hello,

I have a German umlaut "ü" in a button, in the windows simulation, it looks good. In the Browser (IE) it looks like "ü" ...

Regards,
Uwe

JS-Support @Userware
Site Admin
Posts: 1043
Joined: Tue Apr 08, 2014 3:42 pm

Re: German umlaut

Postby JS-Support @Userware » Wed Sep 16, 2015 8:03 am

Hello Uwe,

Thanks for your message.

I am attempting to reproduce the issue but with no avail.

I have created a new Empty project and tried the following XAML code:

Code: Select all

<TextBlock Text="ü" FontSize="30"/>


Please look at the attached screenshot to see the code, and the result. In the screenshot you can see both the Chrome-based Simulator and IE 10 running.

Bug German umlaut.png
Bug German umlaut.png (80.38 KiB) Viewed 3031 times


Can you please send me some other code snippet to reproduce it?

Thanks a lot,
Regards,
JS-Support

CyborgDE
Posts: 75
Joined: Wed Aug 12, 2015 9:21 pm

Re: German umlaut

Postby CyborgDE » Wed Sep 16, 2015 11:39 am

Hello,

I have a XmlReader

Code: Select all

var memoryStream = new MemoryStream(Encoding.UTF8.GetBytes(script));
var xmlReader = XmlReader.Create(memoryStream);

an the command

Code: Select all

xaml = xmlTextReader.ReadElementString();

produce the effect under java, windows is OK !?

Any Idea ?

Regards, Uwe

CyborgDE
Posts: 75
Joined: Wed Aug 12, 2015 9:21 pm

Re: German umlaut

Postby CyborgDE » Sat Oct 17, 2015 12:30 am

Help !!!

The XmlRead can not deal with UTF-8 data !!!

The "ü" ist "\xfc" ...

Regards,
Uwe

CyborgDE
Posts: 75
Joined: Wed Aug 12, 2015 9:21 pm

Re: German umlaut

Postby CyborgDE » Sat Oct 17, 2015 7:28 am

This little piece of code solves the problem, for now.

But why ?

Code: Select all

                            _Value = xmlTextReader.ReadElementString();
                            if (CSharpXamlForHtml5.Environment.IsRunningInJavaScript)
                            {
                                byte[] vals = new byte[_Value.Length];
                                for (int i = 0; i < _Value.Length; i++)
                                {
                                    char ch = _Value[i];
                                    if (ch < 128)
                                    {
                                        vals[i] = (byte)ch;
                                    }
                                    else
                                    {
                                        byte code = JSIL.Verbatim.Expression("ch.charCodeAt(0)");
                                        vals[i] = code;
                                    }
                                }
                                _Value = Encoding.UTF8.GetString(vals);
                            }


Here is the input file loaded via the WebClient :

Code: Select all

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<TransList>
  <Language>ru</Language>
  <TransItem>
    <Key>   Suchen</Key>
    <Value>   Поиск</Value>
  </TransItem>
</TransList>



Regards, Uwe


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 1 guest

 

 

cron