Plugin with Rust

fabrice

Member³
Hello,
i'm learning Rust for myself, so i decided, as an exercice, to develop a plsql developer plugin.
I created all the necessary functions to make my dll reconize.
Add more functions, to make a basic plugin, create menu, windows ...
Most of function for my use was created.
My code is certainly no perfect, but everything works.
But i have a problem i can't resolve for now.
Every string in Rust are save in UTF-8 format, So when i pass it to PLD, accentued char are not represented correctly.

Is there a way to pass UTF-8 string to pl/sql developer?

If someone using rust to, is there a way to convert utf-8 string to iso-latin or someting else, reconized by PLD?

I have no problem with a C++ plugin.

Thanks
 
Last edited:
Perhaps you can use the CHARMODE Plug-In setting?

C++
BOOL IDE_PlugInSetting(int PlugInID char *Setting char *Value)

Delphi
function IDE_PlugInSetting(PlugInID: Integer; Setting, Value: PAnsiChar): Bool

CHARMODE ANSI | UTF8 | UTF8BOM
Determines how PAnsiChar parameters are passed through the Plug-In interface. The UTF8BOM encoding will precede the characters with a BOM indicator when text contains Unicode.
 
after some hours, i have finally found a solution to my problem.
i found a library (crate) to convert my string (textcode::iso8859_15).
I can after easily send my string to pl/sql dev.

I wil try to use the function IDE_PlugInSetting, to see if it's a better solution.
Thanks.
 
Last edited:
I tried to call
bool = IDE_PlugInSetting(PLUGIN_ID, *"CHARMODE", *"UTF8") in OnCreate function.
But string with accentued char are not shown correctly.
Is it the correct way to call this function?

I added some debuglog and obtain a PlugIn Exception.
i have to look further.

OnCreate is not the good place to call IDE_PlugInSetting, RegisterCallBack was not call.

I put the call to IDE_PlugInSetting in then OnActivate function, it seem to work fine but, strings are not correct.
in debug.txt :

IDE_PlugInSetting(CHARMODE, UTF8) [Rust plsql plugin version 1.0]
IDE_PlugInSetting: OK() [Rust plsql plugin version 1.0]
IDE_DebugLog() [Rust plsql plugin version 1.0]
Plug-In: Appel IDE_PlugInSetting : OK

i tried the three options; but none works.
 
Last edited:
In our own Plug-Ins we call this in the OnActivate function. If you set the mode to UTF8, what exactly is displayed for characters with an accent?
 
The problem is not directly in my plugin.
I send pl/sql dev something like "SUBITEM=Tables liées" for a menu item.
The menu item isn't correctly shown, bad chars are display instead of é.
i thought IDE_PlugInSetting function can make pl/sql dev could my menu item correctly.
 
I see. The setting may indeed not work at this level, but merely at the Oracle data level (sources and objects). You can probably pass menu item text as ANSI. For example character 0xE9 for an é.
 
Back
Top