Handle extended ascii and double byte in GUI.
This commit is contained in:
parent
02fb4c49c6
commit
54fb8faee1
@ -587,12 +587,29 @@ namespace Novell.CASA
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (iKeyLen > 1)
|
if (iKeyLen > 1)
|
||||||
sKey = Marshal.PtrToStringAnsi(theKey, (int)iKeyLen - 1);
|
{
|
||||||
|
//sKey = Marshal.PtrToStringAnsi(theKey, (int)iKeyLen - 1);
|
||||||
|
|
||||||
|
// convert from UTF8
|
||||||
|
byte[] baKey = new byte[iKeyLen-1];
|
||||||
|
Marshal.Copy(theKey, baKey, 0, (int)iKeyLen-1);
|
||||||
|
sKey = System.Text.Encoding.UTF8.GetString(baKey, 0, baKey.Length);
|
||||||
|
}
|
||||||
|
|
||||||
if (iValueLen > 1)
|
if (iValueLen > 1)
|
||||||
sValue = Marshal.PtrToStringAnsi(theValue, (int)iValueLen -1);
|
{
|
||||||
|
//sValue = Marshal.PtrToStringAnsi(theValue, (int)iValueLen -1);
|
||||||
secret.setKeyValuePair(sKey, sValue);
|
|
||||||
|
// convert from UTF8
|
||||||
|
byte[] baValue = new byte[iValueLen-1];
|
||||||
|
Marshal.Copy(theValue, baValue, 0, (int)iValueLen-1);
|
||||||
|
sValue = System.Text.Encoding.UTF8.GetString(baValue, 0, baValue.Length);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sKey != null && sValue != null)
|
||||||
|
secret.setKeyValuePair(sKey, sValue);
|
||||||
|
|
||||||
|
|
||||||
iStart = 0;
|
iStart = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -720,7 +737,7 @@ namespace Novell.CASA
|
|||||||
internal bool KeyInNewList(NameValueCollection nvc, string key)
|
internal bool KeyInNewList(NameValueCollection nvc, string key)
|
||||||
{
|
{
|
||||||
|
|
||||||
Console.WriteLine("Checking for " + key );
|
//Console.WriteLine("Checking for " + key );
|
||||||
if (nvc != null)
|
if (nvc != null)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < nvc.Count; i++)
|
for (int i = 0; i < nvc.Count; i++)
|
||||||
|
Loading…
Reference in New Issue
Block a user