Page 1 of 1

How can i convert LANSA Nvarchar type to .net String

Posted: Fri Jun 09, 2017 6:00 pm
by Welcome
Hi,

how can i convert lansa NVARCHAR type to .net String type for use RDMLX.

Define_Com Class(#zsys.System.Net.WebRequest) Name(#request) Reference(*DYNAMIC)
define #address *nvarchar 256
#requestUri := #requestUri.Substitute( #uri.EscapeUriString( #address ) )

error message.
expression #address(type unicode string) is not assignment compatible with expression stringtoEscape (Type String).

Re: How can i convert LANSA Nvarchar type to .net String

Posted: Tue Jun 13, 2017 8:05 am
by MarkDale
I am not sure if this is the right answer for what you are trying to do, but if you want to convert a unicode string to a string, you can use:

#address.AsNativeString

Re: How can i convert LANSA Nvarchar type to .net String

Posted: Tue Jun 13, 2017 9:36 am
by Welcome
Thank you for your reply.
#xxx.asnativestring is right.
but,status bar for vietnam font will appear "?".
(message msgtxt)
so,i try use .net to encoding...

Re: How can i convert LANSA Nvarchar type to .net String

Posted: Tue Jun 13, 2017 11:34 am
by dannyoorburg
It's a bug that .Net component strings are NOT in unicode.

I would report it to LANSA and try to get a fix, I don't think there's any workarounds. If you go native, you'll get question marks for non-native characters.

Regards,
Danny