Unicode Issue - characters are beeing transformed

65 views
Skip to first unread message

Homer Ataru

unread,
Jan 17, 2014, 6:11:15 AM1/17/14
to comman...@googlegroups.com
hello,

i am using CF GUI designer 2.7 and iViewer on an iPod running iOS7. I am working on a project using german language with the occasional Ü, Ä, Ö, and so on.


this characters are provided via an XML file that is loaded within java script linked to CF, and there put into an array. from there we put strings as list items into a script created list (CF.listAdd).

now the problem is, that at some point CF seems to not use unicode (but latin1 maybe), since this special characters do not appear correctly in both the log and on the iPod, when running the program.

xml loading

CF.request(self.url, function (status, headers, body) {
// Check that the URL request returned without error
if (status == 200) {
// Use the returned body and create an XML DOM object
var parser = new DOMParser();
var xmlDoc = parser.parseFromString(body, 'text/xml');


create array 

var newLevel = new Level(levelNodes[i].attributes["number"].value, levelNodes[i].attributes["name"].value);


the xml file is used without header info and such should use UTF-8. I was allready trying several different encodings, nothing seemed to make any difference.


this is what happens:

within the XML the string "Küche" -> becomes "Küche" when shown in iViewer log and in iViewer it self.



since the log shows the same as the device i want to rule out any parttaking of iOS in creating the mess.

Any help on this would be much appreciated, I would be happy if we find a way to display the correct symbols.

One way of dealing with the problem could be to provide the "wrong" symbols within the XML, so they are "transformed" into something i want to see.

Of course i would rather know whats going on exactly, to be able to not use dirty tricks and still reach my goal :)


many thanks in advance! I hope the case is made clear enough, if there are questions, of course i will try to provide more detail.

greez Homer

Jarrod Bell

unread,
Jan 17, 2014, 7:02:15 AM1/17/14
to comman...@googlegroups.com
Would you be able to link us to a copy of the XML?

Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com


--
You received this message because you are subscribed to the Google Groups "CommandFusion Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to commandfusio...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Homer Ataru

unread,
Jan 17, 2014, 7:23:24 AM1/17/14
to comman...@googlegroups.com, jar...@commandfusion.com
sure - first item to look at:   <room number="4">Küche</room>  
 
the problem has to be that CF does not use unicode internaly, i just wonder why our german friends did not come a cross this issue allready :) - atm i save the XML´s with ANSI encoding, which keeps the Umlaute as they where.

the XML itself is rather un exciting..

thanks for the fast response!!! 


<house name="xxxx">
<level name="Keller" number="0">
<room number="1">Vorraum</room>
<room number="2">Garderobe</room>
<room number="3">WC</room>
<room number="4">Küche</room>
<room number="5">Speis</room>
<room number="6">Weinkeller</room>
<room number="7">Wohnzimmer</room>
<room number="8">Fitness</room>
<room number="9">Sauna</room>
<room number="10">Dusche</room>
<room number="11">Terrase</room>
<room number="12">Pool</room>
</level>
<level name="Erdgeschoss" number="1">
<room number="21">Eingangsbereich</room>
<room number="22">Vorraum</room>
<room number="23">Esszimmer</room>
<room number="24">Speis</room>
<room number="25">Büro</room>
<room number="26">Wirtschaftsraum</room>
<room number="27">Wintergarten</room>
</level>
<level name="1. Obergeschoss" number="2">
<room number="41">Schlafzimmer Erika</room>
<room number="42">Schlafzimmer Fritz</room>
<room number="43">Vorraum</room>
</level>
<level name="2. Obergeschoss" number="3">
<room number="61">Vorraum</room>
<room number="62">Wohnküche</room>
<room number="62">Gästezimmer</room>
<room number="64">Badezimmer</room>
</level>
<level name="Gesamt" number="4">
<room number="81">Keller</room>
<room number="82">EG</room>
<room number="83">OG 1</room>
<room number="84">OG 2</room>
<room number="85">Alle Räume</room>
<room number="999">TV Multicon</room>
<room number="998">AV Konfiguration</room>
</level>
</house>

 

Florent Pillet

unread,
Jan 17, 2014, 7:56:32 AM1/17/14
to comman...@googlegroups.com
iViewer is fully unicode-enabled. Make sure (i.e. with the remote debugger, set a breakpoint in the CF.request callback) that the data you are getting back from the server is correct. Also your XML doesn't include any encoding information, this should be included. If your source XML doesn't carry it, concatenate it with the string:

<?xml version="1.0" encoding="UTF-8"?>

This indicates the proper source encoding to use by the XML parser.


Florent


On 17 Jan 2014, at 12:11, Homer Ataru <blee...@gmail.com> wrote:

hello,

i am using CF GUI designer 2.7 and iViewer on an iPod running iOS7. I am working on a project using german language with the occasional Ü, Ä, Ö, and so on.


this characters are provided via an XML file that is loaded within java script linked to CF, and there put into an array. from there we put strings as list items into a script created list (CF.listAdd).

now the problem is, that at some point CF seems to not use unicode (but latin1 maybe), since this special characters do not appear correctly in both the log and on the iPod, when running the program.



--
Florent Pillet - Software Engineering Lead



Jarrod Bell

unread,
Jan 17, 2014, 7:57:41 AM1/17/14
to comman...@googlegroups.com
iViewer has no problem showing unicode characters internally - many german, russian, chinese, japanese, etc, customers use our software with local character sets without issue.
So there must be something specific to your use case. Thank you for the sample XML.


Regards,

Jarrod Bell
CommandFusion
www.commandfusion.com


Bernhard van Leenhoff

unread,
Jan 17, 2014, 8:02:02 AM1/17/14
to comman...@googlegroups.com
i had the header with encoding information exactly as you show it in the xml before, did not make any difference. 
if omitted it should use utf-8 anyway...

i also tried to put some umlaute into an array and from there put it into CF.log (directly as string and also the variable) which did not do the transformation (which makes me regret my accusation about CF / iViewer and unicode - if that would have been the case, this action should have seen a transformation as well... sorry about that). 

well with that said the problem maybe has to be my webserver, from where i load the XML. but still i cant imagine what should be going on there...


2014/1/17 Florent Pillet <fpi...@gmail.com>

--
You received this message because you are subscribed to a topic in the Google Groups "CommandFusion Software" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/commandfusion/Dzyi1II0NVg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to commandfusio...@googlegroups.com.

Bernhard van Leenhoff

unread,
Jan 17, 2014, 8:02:51 AM1/17/14
to comman...@googlegroups.com
yeah you are right. if that was the case, i am sure sombody would have been stumbling over it allready...


2014/1/17 Jarrod Bell <jar...@commandfusion.com>

--
You received this message because you are subscribed to a topic in the Google Groups "CommandFusion Software" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/commandfusion/Dzyi1II0NVg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to commandfusio...@googlegroups.com.

Homer Ataru

unread,
Feb 7, 2014, 7:29:34 AM2/7/14
to comman...@googlegroups.com
just to have this topic closed with a solution, i wanna add, that the problem seemed to have been that the file itself was not saved in ANSI. saving the XML as ANSI from notepad++ lead to the correct display of Umlaut characters (changing the encoding in the xml did not change anything).

not at all an issue within CF, but with my lack of common knowledge..

thanks for your help!
greez 
homer

thechad

unread,
Feb 7, 2014, 8:18:15 AM2/7/14
to comman...@googlegroups.com
Thanks for closing the loop on this. Good to know.
Reply all
Reply to author
Forward
0 new messages