NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
[resolved] UTF-8 problem Nusphere-SimpleXML


Joined: 18 Jan 2008
Posts: 15
Location: Linz/Austria
Reply with quote
When I save a XML file (encoded in UTF-8 ) in NuSphere and try to load it with SimpleXML, I get the following error: Input is not proper UTF-8.

When I save it in Windows editor as UTF-8, it all works perfectly. I've selected UTF-8 as standard encoding in Tools/Settings/IDE Settings. Is there a possibility in Nusphere to correctly save UTF-8, which I haven't found out? Of course, I could edit all XML files in Windows editor, but I'd like to use Nuspehre, because it's plaine better Wink! Anyone an idea Confused?!? ...
View user's profileFind all posts by Thomas DSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Even if you've set Tools/Settings/IDE Settings/Default Encoding to UTF-8, it does not mean that you can't edit non-UTF8 files. This setting is just a 'suggestion' to the IDE what encoding is to try by default when it loads a file for the first time. As soon as you get it loaded, it will remember _YOUR_ choise and will apply selected encoding next time you load the file, regardless what you have in the Default Encoding.
With xml files, the picture includes one more step. Before even trying the Default Encoding, when IDE loads an XML file, it looks for its <?xml version="1.0" encoding="blah blah blah"...> and will apply this encoding (if found) regardless what you have in the Default Encoding.

So, please make sure that you have correct <?xml...?> header in your file and make sure that when you save the file its encoding is set to UTF-8.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 18 Jan 2008
Posts: 15
Location: Linz/Austria
Reply with quote
XML header looks like this:
Code:
<?xml version="1.0" encoding="UTF-8"?>
and I have saved the file with Windows Editor as UTF-encoded file. But Nuspehre has a problem with that as German special characters like ä or ö aren't displayed correctly. If I change this in Nusphere by replacing it with the correct characters, I get the SimpleXML error I was talking about.

As you've recommended it, I copied the correct UTF-8 file in Windows and loaded it in Nusphere. But it still doesn't work Sad.
View user's profileFind all posts by Thomas DSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Quote:
But Nuspehre has a problem with that as German special characters like ä or ö aren't displayed correctly

Would you please archive the source file and screenshot to see how it's displayed in the IDE and make it available online?
or just send it to NuSphere Support team directly.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 18 Jan 2008
Posts: 15
Location: Linz/Austria
Reply with quote
PDF: www.thomasd.info/temp/xmlSiteContent.pdf
Archive of code file: www.thomasd.info/temp/xmlSiteContent.rar

The strange characters in front of <?xml come due to saving it correctly in Windows Editor. Removing and saving them in Nusphere causes the SimpleXML error I was talking about.
View user's profileFind all posts by Thomas DSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
thanks, but the sreenshot is not complete. I mean I can't see all the other IDE parts. Would you please make a screenshot of whole the window?
As far I as understand, you've selected non-utf8 encoding for the file and that's why the German characters were not displayed correct.
Please see how your file is displayed when utf-8 is selected:

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 18 Jan 2008
Posts: 15
Location: Linz/Austria
Reply with quote
Unfortunately my test licence has run out in the meantime. However, I was really satisfied with Nusphere with 2 exceptions: The first one is the UTF-8 problem, which might be solveable. The second one is quite more difficult to explain. Take a simple source code for instance:

Code:

echo "short";
$veryLongCode = "kddddddddddddddddskskskdkdkdkkdkdk HERE!!! dkkdkdkdkkdkskks";
echo $veryLongCode;


When I'm at the position of "HERE!!!" with my cursor and press the up or down arrow of my keyboard there is a huge difference between Nusphere and other common IDEs such as Eclipse or Visual Studio. In Eclipse my cursor is directed right after the semicolon of line 1 or 3 (depends if I pressed 'up' or 'down'). In Nusphere however, the cursor keeps in the same column, as "H" vor instance and there are a lot of spaces to the semicolon on the left. This is pretty annoying and for me the only major minus of Nushere ...
View user's profileFind all posts by Thomas DSend private message


Joined: 25 Aug 2006
Posts: 18
Location: Netherlands
Reply with quote
Ah, thats one of the things I always disable in the options panel:

Tools -> Settings -> Editor Settings -> uncheck "Cursor beyond EOL"

And thats it!
View user's profileFind all posts by SiemaSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
correct. EOL will get its behaviour to match VS. On the other hand, you can enable virtual space in VS and it will let cursor go beyound EOL and it's what many other developers are using too.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
[resolved] UTF-8 problem Nusphere-SimpleXML
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
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic