Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Importstring and Arabic

3 posts in XML Last posting was on 2003-06-18 14:25:56.0Z
mazen Posted on 2003-06-17 16:52:12.0Z
Newsgroups: sybase.public.powerbuilder.xml
From: "mazen" <mazen_hattab@hotmail.com>
Subject: Importstring and Arabic
Date: Tue, 17 Jun 2003 18:52:12 +0200
Lines: 19
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6700
X-MIMEOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
NNTP-Posting-Host: 194.126.1.146
Message-ID: <373_ueYBvnONDHA.339@forums-2-dub>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums-2-dub.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.xml:132
Article PK: 813205

hi all,
i am getting an xml string from a webservice, i am trying to parse it and
use the function importstring function to import this string and put it in
an xml datawindow.
if the string does not contain arabic language it works perfect, but if it
contains arabic powerbuilder crashes. eventhough that the function
importfile works correctly on arabic data but after setting the windows
language default to arabic and installing the encoding options. i tried to
manipulate this problem by writing the xml string into a file then using the
importfile function but it doesn't work cos notepad is saved in Ansi format.
but if i saved the notepad manually in the utf-8 format it works.
so i wonder if there is a solution for this problem. is there any method to
save the notepad in utf-8 format as a final solution or is there a better
solution for manipulating the string. i have tried the pbdom object to test
the xml and it is not showing any error.
Best Regards
10x in advance


Roy Kiesler [TeamSybase] Posted on 2003-06-17 17:13:33.0Z
Newsgroups: sybase.public.powerbuilder.xml
From: "Roy Kiesler [TeamSybase]" <SPAM_FREE_roy.kiesler@teamsybase.com>
Subject: Re: Importstring and Arabic
Date: Tue, 17 Jun 2003 13:13:33 -0400
Lines: 40
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: host131.percussion.com 208.252.62.131
Message-ID: <373_erVWiTPNDHA.187@forums-2-dub>
References: <373_ueYBvnONDHA.339@forums-2-dub>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums-2-dub.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.xml:133
Article PK: 813206

Have you tried using ToUnicode() before writing the XML string to file?

--
<hopethishelps/>
Roy Kiesler [TeamSybase]
SDN CodeXchange -- http://codexchange.sybase.com


--
<hopethishelps/>
Roy Kiesler [TeamSybase]
SDN CodeXchange -- http://codexchange.sybase.com

"mazen" <mazen_hattab@hotmail.com> wrote in message
news:ueYBvnONDHA.339@forums-2-dub...
> hi all,
> i am getting an xml string from a webservice, i am trying to parse it and
> use the function importstring function to import this string and put it in
> an xml datawindow.
> if the string does not contain arabic language it works perfect, but if it
> contains arabic powerbuilder crashes. eventhough that the function
> importfile works correctly on arabic data but after setting the windows
> language default to arabic and installing the encoding options. i tried to
> manipulate this problem by writing the xml string into a file then using
the
> importfile function but it doesn't work cos notepad is saved in Ansi
format.
> but if i saved the notepad manually in the utf-8 format it works.
> so i wonder if there is a solution for this problem. is there any method
to
> save the notepad in utf-8 format as a final solution or is there a better
> solution for manipulating the string. i have tried the pbdom object to
test
> the xml and it is not showing any error.
> Best Regards
> 10x in advance
>
>


Roy Kiesler [TeamSybase] Posted on 2003-06-18 14:25:56.0Z
Newsgroups: sybase.public.powerbuilder.xml
From: "Roy Kiesler [TeamSybase]" <SPAM_FREE_roy.kiesler@teamsybase.com>
Subject: Re: Importstring and Arabic
Date: Wed, 18 Jun 2003 10:25:56 -0400
Lines: 94
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: host131.percussion.com 208.252.62.131
Message-ID: <373_#JuqiaaNDHA.339@forums-2-dub>
References: <373_ueYBvnONDHA.339@forums-2-dub> <373_erVWiTPNDHA.187@forums-2-dub> <373_uLvKZNWNDHA.362@forums-2-dub>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums-2-dub.sybase.com
Xref: forums-1-dub sybase.public.powerbuilder.xml:138
Article PK: 813209

Looking at your code, you are reading the XML file into a string variable --
that will not work, as PB strings are ANSI strings. You should read the file
into a blob variable.

Note the following quote from the online help:

"Unicode file format Unicode files have two extra bytes at the start of the
file to indicate that they are Unicode files. If you are opening a Unicode
file in stream mode, skip the first two bytes."

If you are still having issues, I suggest you open a case with support on
this.

--
<hopethishelps/>
Roy Kiesler [TeamSybase]
SDN CodeXchange -- http://codexchange.sybase.com

"mazen" <mazen_hattab@hotmail.com> wrote in message
news:uLvKZNWNDHA.362@forums-2-dub...
> Dear Roy
> please find attached the application code with the notepad file that i am
> trying to read from it .
> note that if there is a solution like mentionned before which prevent
using
> the notepad issue it will be great.
> i have tried to use the Tounicode() before writing the xml string to the
> file but it failed
> also
> i've tried to read the notepad string character by character and do the
> unicode transformation using "tounicode()" but it doesnt work.
> please simulate this issue, all the necessary files and code are attached.
> you can find it in w_nbk on the button click event
> i appreciate your help
> 10x alot in advance
>
> "Roy Kiesler [TeamSybase]" <SPAM_FREE_roy.kiesler@teamsybase.com> wrote in
> message news:erVWiTPNDHA.187@forums-2-dub...
> > Have you tried using ToUnicode() before writing the XML string to file?
> >
> > --
> > <hopethishelps/>
> > Roy Kiesler [TeamSybase]
> > SDN CodeXchange -- http://codexchange.sybase.com
> >
> >
> > --
> > <hopethishelps/>
> > Roy Kiesler [TeamSybase]
> > SDN CodeXchange -- http://codexchange.sybase.com
> >
> > "mazen" <mazen_hattab@hotmail.com> wrote in message
> > news:ueYBvnONDHA.339@forums-2-dub...
> > > hi all,
> > > i am getting an xml string from a webservice, i am trying to parse it
> and
> > > use the function importstring function to import this string and put
it
> in
> > > an xml datawindow.
> > > if the string does not contain arabic language it works perfect, but
if
> it
> > > contains arabic powerbuilder crashes. eventhough that the function
> > > importfile works correctly on arabic data but after setting the
windows
> > > language default to arabic and installing the encoding options. i
tried
> to
> > > manipulate this problem by writing the xml string into a file then
using
> > the
> > > importfile function but it doesn't work cos notepad is saved in Ansi
> > format.
> > > but if i saved the notepad manually in the utf-8 format it works.
> > > so i wonder if there is a solution for this problem. is there any
method
> > to
> > > save the notepad in utf-8 format as a final solution or is there a
> better
> > > solution for manipulating the string. i have tried the pbdom object to
> > test
> > > the xml and it is not showing any error.
> > > Best Regards
> > > 10x in advance
> > >
> > >
> >
> >
>
>
>