XML special character problem

131 views
Skip to first unread message

nbato...@wings.rs

unread,
Apr 5, 2023, 10:29:09 PM4/5/23
to harbou...@googlegroups.com

I have XML with attributes which contaings special characters  
  and 
 -- sample XML is in attach. For reading I use this simple code:

 

PROC Main

   CLS

   oDoc := TXmlDocument():new()

   oDoc:read(MemoRead("c:\tmp\pp.xml"))

 

   x1 := oDoc:findFirst ("Stavke")

   ? s1 := x1:aAttributes["naziv"]

 

   x2 := oDoc:findNext ()

   ? s2 := x2:aAttributes["naziv"]

   

   x3 := oDoc:findNext ()

   ? s3 := x3:aAttributes["naziv"]

 

RETURN

 

Result change every time I start this program???

 

 

Does anyone know what the problem is?

 

Thanks in advance, NB

image001.png
PP.xml

Rafa Pabd

unread,
Apr 10, 2023, 9:10:40 AM4/10/23
to Harbour Users
Try your country codepage

Example:
   REQUEST HB_LANG_PT
   REQUEST HB_CODEPAGE_PTISO
   HB_CDPSELECT( "PTISO" )

theos theos

unread,
Apr 10, 2023, 10:30:23 AM4/10/23
to Harbour Users

yo también he tenido esos problemas resolví con lo siguiente :
mi editor de texto es ANSI 

REQUEST HB_CODEPAGE_ESWIN                     // ESWIN emplaza por tu idioma

PROCEDURE Main()

     hb_cdpSelect( "ESWIN" )
     hb_SetTermCP( "ESWIN" )  
  
     @ 2,2, 20,40 BOX CHR(201)+CHR(205)+CHR(187)+CHR(186)+CHR(188)+CHR(205)+CHR(200)+CHR(186)
      
     ? "María"
      
RETURN
Reply all
Reply to author
Forward
0 new messages