Discussion:
ScintillaNET problem..
(too old to reply)
g***@experientia.org
2004-05-05 12:39:10 UTC
Permalink
I'm busy building a new wrapper for Scintilla for .NET right now. It will be somewhat more comprehensive than the current one. ( as well as cross platform :-) )

The existing wrapper has some limitations when playing with text that I hope to overcome in the next version.

You can try to change the ASCII encoding to UTF8 and recompile the wrapper, but I haven't worked with this yet.

Garrett


________________________________


From: scintilla-interest-***@lyra.org [mailto:scintilla-interest-***@lyra.org] On Behalf Of João Brites
Sent: Wednesday, May 05, 2004 5:43 AM
To: Discussion of the Scintilla editing component
Subject: [scintilla] ScintillaNET problem...

Hi again,

I'm still having problems with enconding in scintilla. I've set codepage to 850 (latin) or 65001 (unicode) but i canŽt get it to work.

When i try something like this on my code:

ScintillaControl.Text = "<html><body>João</body></html>";

it turns to "<html><body>Jo?o</body></html>" in my application.

I looked into ScintilaNET source code and realized that all string operations are done in ASCII, does my problem have anything to do with this?

Is there any solution to this?

Thanks in advance ;)



João Brites
mjm
2004-05-05 19:18:26 UTC
Permalink
Hi Garrett,
I'm busy building a new wrapper for Scintilla for .NET right now. It will be somewhat more comprehensive than the current one. ( as well as >cross platform :-) )
The existing wrapper has some limitations when playing with text that I hope to overcome in the next version.
You can try to change the ASCII encoding to UTF8 and recompile the wrapper, but I haven't worked with this yet.
While you are busy with it, could you please also have a look at marginclick handler,
currently you are passing only scintillacontrol as parameter:MarginClick( this ),
usefull would be to have position where user clicked, e.g.: MarginClick( this, scintilla_notification->position);
or something like described here:
http://scintilla.sourceforge.net/ScintillaDoc.html#SCN_MARGINCLICK

tia,
-m
Craig Andera
2004-05-05 13:18:18 UTC
Permalink
Post by g***@experientia.org
You can try to change the ASCII encoding to UTF8 and recompile the
wrapper, but I haven't worked with this yet.
I did exactly that, and it didn't quite seem to do the trick. I'm going to
be working on this problem sometime soon - ideally this week - for
FlexWikiPad [1], so if I figure it out, I'll post the answer back here.

[1] http://sf.net/projects/fwcontrib
g***@experientia.org
2004-05-05 19:23:45 UTC
Permalink
Will do.

I'm going to put in a whole new event mapping mechanism while I'm at it. I'm hoping to keep fairly close to the current method/property names, but there may be a few differences.

I've just about finished the generator that takes the scintilla.iface file and produces the majority of the wrapper code, and it's all downhill from there :)

Garrett


________________________________

From: scintilla-interest-***@lyra.org on behalf of mjm
Sent: Wed 5/5/2004 1:18 PM
To: Discussion of the Scintilla editing component
Subject: Re: [scintilla] ScintillaNET problem..



Hi Garrett,
I'm busy building a new wrapper for Scintilla for .NET right now. It will be somewhat more comprehensive than the current one. ( as well as >cross platform :-) )
The existing wrapper has some limitations when playing with text that I hope to overcome in the next version.
You can try to change the ASCII encoding to UTF8 and recompile the wrapper, but I haven't worked with this yet.
While you are busy with it, could you please also have a look at marginclick handler,
currently you are passing only scintillacontrol as parameter:MarginClick( this ),
usefull would be to have position where user clicked, e.g.: MarginClick( this, scintilla_notification->position);
or something like described here:
http://scintilla.sourceforge.net/ScintillaDoc.html#SCN_MARGINCLICK

tia,
-m
Craig Andera
2004-05-05 21:02:23 UTC
Permalink
Post by g***@experientia.org
I'm going to put in a whole new event mapping mechanism while I'm at it.
I'm hoping to keep fairly close to the current method/property names, but
there may be a few differences.
I've just about finished the generator that takes the scintilla.iface file
and produces the majority of the wrapper code, and it's all downhill from
there :)
As another suggestion, please get rid of any types defined in the global
namespace. For example, the presence of the Point type in the current
scintillanet assembly means having to do something like this:

using SDPoint = System.Drawing.Point;

public void Foo(SDPoint point) {}

just to be able to make use of System.Drawing.Point. Ugly, I'm sure you'll
agree.
g***@experientia.org
2004-05-05 20:56:21 UTC
Permalink
You will probably have to set the code page in the ScintillaControl to 65001 -- (from Scintilla Dox:)

Code page SC_CP_UTF8 (65001) sets Scintilla into Unicode mode with the document treated as a sequence of characters expressed in UTF-8.

That will probably finish the job :)

The new version will handle this transparently... I'm probably going to make UTF-8 the default.

Garrett

________________________________

From: scintilla-interest-***@lyra.org on behalf of Craig Andera
Sent: Wed 5/5/2004 7:18 AM
To: 'Discussion of the Scintilla editing component'
Subject: RE: [scintilla] ScintillaNET problem..
Post by g***@experientia.org
You can try to change the ASCII encoding to UTF8 and recompile the
wrapper, but I haven't worked with this yet.
I did exactly that, and it didn't quite seem to do the trick. I'm going to
be working on this problem sometime soon - ideally this week - for
FlexWikiPad [1], so if I figure it out, I'll post the answer back here.

[1] http://sf.net/projects/fwcontrib
Craig Andera
2004-05-08 13:42:20 UTC
Permalink
Post by g***@experientia.org
You will probably have to set the code page in the ScintillaControl to
65001 -- (from Scintilla Dox:)
Code page SC_CP_UTF8 (65001) sets Scintilla into Unicode mode with the
document treated as a sequence of characters expressed in UTF-8.
That will probably finish the job :)
Actually, I did that too. But I think I may have had compounding factors
that had nothing to do with ScintillaNET. Thanks for the tip, though!
Post by g***@experientia.org
The new version will handle this transparently... I'm probably going to
make UTF-8 the default.
That makes total sense. Since we only get a string object back, not a
byte[], it's already Unicode. With the support in System.Text, you can
encode the text however you like. Of course, that might result in multiple
copies of the buffer, but you can always provide something like this:

public byte[] GetBytes(Encoding encoding);

To allow people to specify a particular encoding.

Anyway, for my part, forcing Unicode mode on scintilla and using the UTF8
encoder will be totally sufficient.

Garrett Serack
2004-05-08 14:51:04 UTC
Permalink
As another suggestion, please get rid of any types defined >in the global
namespace. For example, the presence of the Point type in >the current
using SDPoint = System.Drawing.Point;
public void Foo(SDPoint point) {}
just to be able to make use of System.Drawing.Point. Ugly, >I'm sure you'll
agree.
Yeah, types in the global namespace were the result of
them being included in the C++ source.

This time around, it's all in C#, so there won't be
anything outside of the Scintilla namespace heirarchy.

And for those who asked, it *should* support additional
lexers, as I'm using a standard build of the SciLexer
component, which should allow for external lexers to be
loaded.

G
Continue reading on narkive:
Loading...