How can i convert LANSA Nvarchar type to .net String

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
Welcome
Posts: 18
Joined: Mon May 08, 2017 3:15 pm

How can i convert LANSA Nvarchar type to .net String

Post 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).
MarkDale
Posts: 116
Joined: Wed Dec 02, 2015 10:06 am

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

Post 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
Welcome
Posts: 18
Joined: Mon May 08, 2017 3:15 pm

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

Post 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...
dannyoorburg
Posts: 177
Joined: Mon Jan 04, 2016 9:50 am
Location: Australia

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

Post 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
Post Reply