A .NET plugin that needs to handle ANSI characters in
the range 128 to 255, including the $CustomChar's,
gets corrupted characters. The problem is that the
DNBridge does not convert to UTF8 when calling the
custom DLL and does not convert the high end
characters that are returned.
The issue is that characters above 127 in UTF8 have a
two character pair starting with 194 or 195 and then a
character 128-129.
As an example a plugin that returns a string containing
an e-accute character returns 195:169 and not 233 and
Smartie displays this as two characters (A-tilda and
copywrite). DNBridge assumes 7 bit ASCII strings and
not 8 bit ANSI and treats them as UTF8.
The attached code is a standard C++ (non .NET) plugin
with function 2 converting the UTF8 string to ANSI. This
is my workaround, but is cumbersome. It would be
better if this code could be added to DNBridge in the
buffer returned from BridgeFunc. It would also be good
to carry out the reverse conversion with the params on
the way in.
mcix c++ Smartie plugin with UTF8 to ANSI conversion
Logged In: YES
user_id=1257465
I have provided a patched version of DNBridge at
http://www.axcis.com.au/shop/index.php?
main_page=product_info&cPath=2&products_id=6
Logged In: YES
user_id=1114156
Thanks! I have to attempt that I had no idea what I was
doing whilst creating dnbridge - I'm glad to receive any
changes you want to make.
I will apply your changes as soon as I have some spare time.
Thanks!
Logged In: YES
user_id=1257465
The original DNBridge works great and I have just fixed an
odd quirk with UTF8. This is only needed for special
characters.
Logged In: YES
user_id=1114156
Hi Mike, Are you happy to make your changes open-source?
I.e. Am I able to add the changes to the LCD Smartie code base?
[I've finally found some spare time!]
Logged In: YES
user_id=1257465
Yes, I am happy for my changes to be open-source.
Mike.