XML weirdness with encoded characters

Posts   
 
    
Marcus avatar
Marcus
User
Posts: 747
Joined: 23-Apr-2004
# Posted on: 06-Sep-2007 18:19:57   

Hi Frans / Support... Long time no see!

I am trying to track down a bug which is causing problem for me:

In I am calling an SP via Adapter.CallRetrievalStoredProcedure (V 2.0.0.0).

An XML parameter is being created that includes Unicode encoded character á (which is "á")

XML string is "<ArrayOfStrings><E>á</E></ArrayOfStrings>"

But this is being saved in the DB as "<ArrayOfStrings><E>á</E></ArrayOfStrings>"

and the SQL Profiler is showing:

declare @p1 xml
set @p1=convert(xml,N'<ArrayOfStrings><E>á</E></ArrayOfStrings>')
exec [ModernArk].[dbo].[Ark_CreateTags] @TagNames=@p1

If I wrap with CDATA it works:

declare @p1 xml
set @p1=convert(xml,N'<ArrayOfStrings><E><![CDATA[&#225;]]></E></ArrayOfStrings>')
exec [ModernArk].[dbo].[Ark_CreateTags] @TagNames=@p1

Do I need to wrap with CDATA or is there something going on in LLBLGen that is causing this to be unencoded?

Marcus

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 07-Sep-2007 10:27:38   

Do I need to wrap with CDATA or is there something going on in LLBLGen that is causing this to be unencoded?

I don't think LLBLGen Pro is doing anything behind the scenes. So I think you'll have to use CDATA.