Page 1 of 1

CSE Std 11.01 & PhpED 6.2

Posted: Fri Mar 30, 2012 3:28 pm
by jayaitch
IIRC PhpED is not among the programs supported by CSE Validator (like TopStyle, Homesite or UltraEdit). Anyway, it ships with the Lite version (6.5 if setup tells the truth) and picks up an installed standard version (11.01) automagically.

However, with UTF-8 files umlauts, diacritics, cyrillic characters, etc. result in this CSE message:
At least one character (code point) between 128 and 159 (inclusive) was found on line 6. These code points are commonly found in Windows character sets like Windows-1252 but may not work for everyone, especially those not using Windows. Consider using "& #376;" instead of this character.
Opening the very same file in e.g. CSE Editor or SciTE it opens as UTF-8 (as saved in PhpED) and validates fine.

Opening it intentionally as ANSI in SciTE the expanded double byte characters easily demonstrate why in PhpED CSE issues seemingly silly suggestions as to replace certain characters by the & euro; entity: obviously PhpED passes the file to CSE as ANSI, not UTF-8.

AFAICT from setup PhpED uses csevalidatorV110.dll and passes the full filename. It also uses the regular CSE configuration (confirmed by config changes done in CSE and reflected by messages shown in PhpED).

Maybe PhpED is backwards and uses a dated interface to CSE? (Probably CSE 6.5 was not supporting UTF-8 at all?)

A workaround would be to turn off the charcters 128-159 check in CSE, but I rather would not do that as we also have ISO-8859 encoded projects.

Posting the problem on the NuSphere forum I got this reply from a site admin:
If your "UTF-8" file contains characters in that range - it is not a UTF-8 file because this encoding does not allow characters in this range.
If CSE while running under PhpED does complaint about them - it is correct
If CSE while running out of PhpED does not complaint about them - it is either incorrect or corresponding setting or check is OFF.
... which definitely suggests some further implications. ;)

This is the typical pillar-to-post situation of course, but maybe you have some suggestions for the pillar to fix this ...

TIA

jayaitch

Re: CSE Std 11.01 & PhpED 6.2

Posted: Fri Mar 30, 2012 3:51 pm
by Albert Wiersch
Hello,

PhpED is actually listed here:
http://www.htmlvalidator.com/htmlval/integration.html

If it is shipping with CSE HTML Validator 6.5, then it could definitely use an upgrade. The oldest we have on the site now if v7, and that's only because it's the latest version that supports Windows 9x.

I'm not sure how PhpED is integrating exactly, but you're right that it's probably using an outdated interface. It would likely be easy to convert to the updated interface. For example, recent versions of CSE HTML Validator can take wide string arguments, and those should be used instead of the older "ANSI" versions. It should be very easy to switch to the new wide string functions.

I'd be happy to assist the developer in this (please let them know).

Here is more information that may help:
http://www.htmlvalidator.com/htmlval/de ... ordll.html
http://www.htmlvalidator.com/htmlval/de ... docode.txt

Re: CSE Std 11.01 & PhpED 6.2

Posted: Mon Apr 02, 2012 3:32 pm
by jayaitch
Hi Albert,

thanks for the prompt reply. I will pass on your post to the related thread on the NuSphere forum or - depending on the reaction - file a bug report.

Meanwhile I reinstalled PhpED 6.2 with the included CSE HTML Validator Lite, and it's version 6.52.2 indeed.

With CSE HTML Validator 6.5 Lite there are no range 128-158 errors in UTF-8 files. The relevant setting Allow numeric references 128-159 is unchecked (default).

Switching PhpED back to use CSE HTML Validator 11.01 Std those errors return. Here Allow numeric references 128-159 is unchecked, too, and Check for characters 128-159 (does not apply to Unicode encoded documents) checked (both the default settings). IIRC the latter option is not available in 6.5 Lite (uninstalled again already), and it is this option which "toggles" the errors in PhpED.

JayAitch

Re: CSE Std 11.01 & PhpED 6.2

Posted: Mon Apr 02, 2012 5:24 pm
by Lou
jayaitch wrote: I will pass on your post to the related thread on the NuSphere forum or - depending on the reaction - file a bug report.
<snip>
Meanwhile I reinstalled PhpED 6.2 <snip>
Quick look at the NuSphere/phpEd website I see that phpEd is selling version 7.0 That might solve the problem with interface to a current CSE HTML Validator.

Re: CSE Std 11.01 & PhpED 6.2

Posted: Wed Apr 04, 2012 2:46 pm
by jayaitch
7.0 war released last week, and I won't go for it until at least some more have passed. Version 6.2 was released in December, 6.0 about a year ago. CSE Validator 6.5 is from 2004, so don't expect too much now from PhpED 7. ;)

Anyway, I might learn from support which version of CSE PhpED is shipping with now.

jayaitch

Re: CSE Std 11.01 & PhpED 6.2

Posted: Tue Apr 10, 2012 12:11 pm
by jayaitch
From the PHP IDE team:
dmitri wrote:In fact no newer versions of CSE Lite would work stable under PhpED -- they crash almost immediately after some calls because CSE is trying to show nag window and does so in the thread the library is called in. Because we use a dedicated worker thread for all kinds of background processes, CSE calls GUI functions from this thread. CSE is written in a library that it's not intended to call GUI from threads other than main thread and such calls results in crashes in CSE itself.
Some years ago I already contacted Albert, but seems he didn't find a proper solution for us.
BTW you can try your best and pass your questions to him too.
However, specifying csevalidatorV110.dll in External Tools->CSE Validator did not crash PhpED in a couple weeks. After all DLL is about integration, not GUI.

A small clue emerged yet as if the file contains the full-blown <meta http-equiv="content-type" content="text/html; charset=UTF-8"> header then those "character between 128 and 159" errors disappear. Changing this to "iso-8859-1" w/o converting the actual file encoding the errors return. However, doing the same in either TopStyle or CSE Editor the validator is not fooled, but still validates the file as UTF-8, thus no errors because of expanded double byte characters. Maybe these prepend the stream with a BOM or set a flag for files recognized as UTF-8. PhpED itself recognizes a UTF-8 file even without that header, though it keeps that to itself obviously.

The full thread can be found at http://forum.nusphere.com/cse-html-vali ... t8322.html

JayAitch

Re: CSE Std 11.01 & PhpED 6.2

Posted: Tue Apr 10, 2012 3:25 pm
by Albert Wiersch
JayAitch,

Thanks for helping with this. Could you ask dmitri to contact me at support at htmlvalidator dot com? I'd be happy to discuss with him updating the DLL. I would be happy to address any problems at that time, and make suggestions for better integration with CSE HTML Validator. If this can be done, then it is likely that it would solve the issue, and if not, then the problem could be researched further (after the DLL and interface to it has been updated).

Re: CSE Std 11.01 & PhpED 6.2

Posted: Tue Apr 10, 2012 4:31 pm
by jayaitch
Albert,

thanks for offering a hand in this matter. I sent Dmitri a PM with your email. Hope that will be more successful than the discussion has been so far.

Looking forward to a solution,

JayAitch