Text 2667, 1061 rader
Skriven 2005-02-21 20:52:26 av Rich (1:379/45)
Kommentar till text 2665 av Ellen K. (1:379/45)
Ärende: Re: ESB / XML / Unicode vs 8-bit characters ?
=====================================================
From: "Rich" <@>
This is a multi-part message in MIME format.
------=_NextPart_000_0A18_01C51857.402030C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I don't understand why oracle using UTF-8 wouldn't work and oracle =
using UTF-16 would. That sounds like an oracle problem.
There are two XML issues I see.
One, and the only bug in what we have discussed, is that the encoding =
declared in the ?xml PI must match the actual encoding of the file. You = can
use any encoding that is supported as long as your XML document is = correctly
encoded in whatever is declared.
The second issue is what encodings does your software support. I =
believe all XML implementations to claim compliance must support UTF-8 = and
UTF-16. Most should support more. I haven't tried Microsoft SQL = Server but
I would expect it to handle any of the encodings with support = installed on
that host machine. Windows supports many encodings. I = just checked my
machine and see more than 100 supported encodings.
My suggestion is to stick with UTF-8 for the stuff you generate if =
you can. For what you have to consume from other software simply has to =
work. If not you can go back to the folks responsible for creating it = and
find a way to make it valid.
Rich
"Ellen K." <72322.1016@compuserve.com> wrote in message =
news:qt9l115cio5kc8ijjumaubpvb6n9ig50ir@4ax.com...
Argggh, I replied from work using Dale's mirror, it doesn't show up
here, waitaminnit...
OK, here we go:
First of all I have to say you have once again earned my eternal
gratitude, I am so glad you are here. :)
I still have to make a decision regarding the standard I want to
request. Are you saying that if for example I get XML generated by =
say
SalesForce with UTF-8 specified and it includes these characters, I
would not have a problem? Stuff I write myself I'm not worried about
because I have the opportunity to tweak it, what I'm worried about is
what the ESB will try to feed my databases. Since even the hand-typed
XML was accepted when UTF-16 was specified, I'm kind of leaning toward
that, especially since the Oracle guy told me that the TJ accounting
manager used to complain that the Spanish characters weren't coming
out on reports when we were on Oracle 8.x which used UTF-8 but as soon
as we moved to 9.x which uses UTF-16 there were no more problems. =
What
(if any) do you see as a potential downside to UTF-16?
Thanks again. :)
=20
=20
On Mon, 21 Feb 2005 00:24:53 -0800, "Rich" <@> wrote in message
<42199a9e@w3.nls.net>:
> The problem is not that UTF-8 won't work for what you call Spanish =
characters. UTF-8 can encode anything that you consider a character. = The
problem is that when these characters are present they are not being = encoded
in UTF-8. There are two straight forward solutions I see. One = is to encode
the XML correctly in UTF-8. The other is to encode the XML = in the Windows
ANSI encoding I suspect you are using and to tag it = correctly. On a Windows
U.S. English system this would be = "Windows-1252". I would expect SQL Server
to support this. Other = applications may or may not. You could also use
UTF-16 as long as you = generate your XML in UTF-16. I don't know if this is
simple for your = application or not. If you are using VB 7.0 it should be.
>
>Rich
>
> "Ellen K." <72322.1016@compuserve.com> wrote in message =
news:of2j11lqf4r4h1dsnvok8i1dv7c9e3rlb2@4ax.com...
> Well. You just helped me learn a lot. For one thing, I guess I
> thought that because the Spanish characters can be expressed as 8 =
bits
> they were ASCII. =20
>
> I just made a little test stored procedure taking an XML document =
as a
> parameter, created the document manually in Notepad with UTF-8 =
specified
> in the header and tried including some of the Spanish characters... =
and
> it failed. SQL Server could not execute sp_xml_preparedocument =
because
> "an invalid character was found in text content". Just to make =
sure
> that was the problem I substituted non-Spanish characters for the
> Spanish ones and it executed fine. However, I can manually type =
the
> text with the Spanish characters into the varchar field if I open =
the
> table in EnterpriseManager and SQL Server is perfectly happy. =
OTOH, if
> I specify UTF-16, I get "Switch from current encoding to specified
> encoding not supported." Next thing I tried was cloning the sproc =
to
> write to the table with the nvarchar column, still no joy, same =
error
> message... but on changing the datatype of the input parameter from =
text
> to ntext it worked fine. BUT here's the surprise (OK, to me it was =
a
> surprise): If I again clone the sproc to point to the table with =
the
> varchar column, but leave the input parameter as ntext and specify
> UTF-16 in the document header, it works. In other words, a varchar =
(and
> presumably a char) column can successfully accept unicode data even
> though char and varchar are explicitly defined as non-unicode =
datatypes!
>
> Now I have to understand whether I have a problem at work. I =
never
> experienced this problem in real life because none of the data we
> currently send using XML includes any of the Spanish characters. =
Is
> the problem only going to occur if the XML document is constructed =
using
> the concatenated-string method? Or would it happen any time an =
XML
> document specified as UTF-8 included Spanish characters? (The =
data
> sent by SalesForce to the ODS is likely to include Spanish =
characters,
> but it probably creates the XML some other way.) Do I need to tell =
the
> consulting outfit to specify all XML as UTF-16? =20
>
> For the ETL from the ODS to the data warehouse I am not planning to =
use
> Sonic, but rather probably to link the databases and use a bunch of
> stored procedures controlled by some VB code, IOW I will not need =
XML
> because all the extract sprocs will look like INSERT INTO....SELECT
> FROM.
>
> I don't yet understand why UTF-8 can't work for the Spanish
> characters... (unless it only doesn't work when the characters are
> manually typed into the document). If I correctly understand the
> document to which you referred me, an 8-bit character can't fit in =
one
> UTF-8 byte because the first bit is reserved for indicating which =
is the
> first byte of a UTF-8 multi-byte character. (This was your point =
about
> not greater than 0x7F.) But why wouldn't it just make two bytes =
out of
> the Spanish characters then? The documentation says UTF-8 uses
> multiple bytes for the characters that it can't fit into one byte. =
>
> ???
>
>
>
> On Sun, 20 Feb 2005 13:10:40 -0800, "Rich" <@> wrote in message
> <4218fc91@w3.nls.net>:
>
> > The Spanish accented characters are not part of ASCII. They =
are part of Windows calls ANSI of which ASCII is the subset (0x00 to = 0x7F).
Any character in the 0x80 to 0xFF range is not compatible = between ANSI and
UTF-8.
> >
> >Rich
> >
> > "Ellen K." <72322.1016@compuserve.com> wrote in message =
news:7ouh119ivmuk26icg3mqqqk2ss1lfm5c10@4ax.com...
> > Should not have any non-ASCII characters, as previously noted =
all the
> > special Spanish characters are available in the ASCII character =
set.
> > And since the company is built on our understanding of the =
Hispanic
> > market, I don't see any use of, say, pictograph-based languages =
in the
> > foreseeable future. If 10 years down the road something like =
that
> > happens, well, by then we will no longer need compatibility with =
the
> > current legacy system because it will long since have been =
replaced.
> >
> > On Sun, 20 Feb 2005 12:52:25 -0800, "Rich" <@> wrote in message
> > <4218f849$1@w3.nls.net>:
> >
> > > From what you describe below, if the values you emit to XML =
have non-ASCII characters I would expect you to have a problem.
> > >
> > >Rich
> > >
> > > "Ellen K." <72322.1016@compuserve.com> wrote in message =
news:eanh11h4vv6b9v21fiaounii3f5dunjl3g@4ax.com...
> > > On Sat, 19 Feb 2005 23:32:37 -0800, "Rich" <@> wrote in =
message
> > > <42183ccd@w3.nls.net>:
> > >
> > > > The UTF in UTF-8/16/32 stands for Unicode Transformation =
Format. You can find these defined in section 2.5 of =
http://www.unicode.org/versions/Unicode4.0.0/ch02.pdf.
> > >
> > > THANK YOU SO MUCH!!! :)
> > > >
> > > > It's not clear to me how you are creating the XML from =
the templates. If ANSI data is emitted into an XML document declared as =
UTF-8 then you would have problems only for non-ASCII characters. UTF-8 = and
Windows-1252 are identical for 0x00 to 0x7F which is ASCII in both.
> > >
> > > I don't have a copy of a template here at home, but I have =
them create
> > > it by string concatenation because that seems to be the only =
way to be
> > > able to have CDATA attributes, which I have to have because =
in the
> > > legacy data numeric-appearing identifiers are actually =
10-character
> > > strings with leading spaces, and if these are not specified =
as CDATA
> > > the spaces go lost even with "xml:space=3D"preserve"" =
included in the
> > > header. Here is a code snippet from one of my apps that =
creates an XML
> > > document which is passed as a parameter to a SQL Server =
stored
> > > procedure:
> > >
> > > > strXM =3D "<?xml version =3D" & Chr(34) & "1.0" & =
Chr(34) & " encoding=3D" & Chr(34) & "UTF-8" & Chr(34) & "?>" & vbCrLf = _
> > > > & "<ROOT xml:space=3D" & Chr(34) & "preserve" & =
Chr(34) & ">" & vbCrLf
> > > >
> > > > Do While Not .EOF
> > > > strXM =3D strXM & "<M><A>" & !Ofc & =
"</A><B><![CDATA[" & !Contract & "]]></B><C>" & !TCode & "</C><D>" & =
!Date & "</D>" _
> > > > & "<E><![CDATA[" & !TransNo & "]]></E></M>" =
& vbCrLf
> > > > .MoveNext
> > > > Loop
> > > >
> > > > strXM =3D strXM & "</ROOT>"
> > >
> > > (The vbCrLf's are there so if there is a problem the document =
can be
> > > printed to a text file and be easier for humans to read -- =
SQL Server
> > > ignores them. The single-character aliases for entity and =
attribute
> > > names are for performance -- for most of the stuff we use =
these for it
> > > doesn't really matter because we are only sending a few rows, =
but the
> > > first time I did it it was for something that was sending =
about 5000
> > > rows and there it made a huge difference, so I stuck with it. =
We
> > > comment both the front-end code and the stored procedure with =
the
> > > mappings of these aliases.)
> > >
> > > > I do not know how SQL Server maps from char to nchar, =
specifically what conversion is performed. Also, in some (maybe all =
released) versions of SQL Server nchar and nvarchar are encoded in = UCS-2.
UCS-2 is a 16-bit encoding like UTF-16. It dates back to when = Unicode was
defined as having 2**16 characters instead of the 2**20+ = that it has now.
You can not express characters >=3D U+10000 in UCS-2 = not that you care about
these.
> > >
> > > Thankfully, no. :)
> > > >
> > > > I don't know if whether those systems you describe being =
written in java make a difference. They can do what they want. The = native
java string is Unicode though I don't remember if it is UCS-2 or = UTF-16. My
guess is that it was once the former and is now the latter. = One of the
documents on this on sun's site suggests that java used UCS-2 = until the
recently released 1.5 which is the first to use UTF-16.
> > >
> > > The Java native string being unicode is exactly what made me =
start
> > > worrying -- when I was learning Java a couple of years ago =
(because I
> > > wanted to port an app to it so as to be able to run it right =
on the Unix
> > > box where the Oracle database was) I was horrified the first =
time I
> > > tried reading back what I had written to a text file when I =
saw spaces
> > > between all the characters.
> > > >
> > > >Rich
> > > >
> > > > "Ellen K." <72322.1016@compuserve.com> wrote in message =
news:aqag115606i9g8bmh3lst66une1f1sotth@4ax.com...
> > > > UTF-8 is unicode?!? Sheesh, all this time I thought it =
meant 8-bit.
> > > > In fact I could swear I read that somewhere.
> > > >
> > > > My question was coming from the database perspective, =
where I always use
> > > > char and varchar, as opposed to nchar and nvarchar. I =
give the
> > > > front-end guys little templates for creating the XML =
documents for all
> > > > my SQL Server stored procedures that take XML input, and I =
always
> > > > specify UTF-8 in the header... and my char and varchar =
columns always
> > > > end up normal, so since you're now telling me UTF-8 is =
really unicode, I
> > > > guess that would answer my question for XML data I would =
be getting from
> > > > the apps...? Or would the answer be different if the =
incoming XML is
> > > > some other encoding?
> > > >
> > > > To simulate getting nvarchar data from somewhere, I just =
tried creating
> > > > two dummy tables, one with an nvarchar column and the =
other with a
> > > > varchar column, typed stuff into the nvarchar one, then =
inserted to the
> > > > varchar one select from the nvarchar one and it looks =
normal. =20
> > > >
> > > > If all this means I was worrying about nothing, excellent! =
OTOH, is
> > > > there something I should be worrying about that I didn't =
ask?
> > > >
> > > > The only pieces whose names I know so far are Sonic and =
SalesForce, both
> > > > of which are written in Java, if that makes any =
difference. I know
> > > > there is at least one other external piece but I think =
that is the next
> > > > phase.
> > > >
> > > > On Sat, 19 Feb 2005 21:37:15 -0800, "Rich" <@> wrote in =
message
> > > > <421821c1$1@w3.nls.net>:
> > > >
> > > > > You need to be more specific than "8-bit characters". =
There are many 8-bit character encodings. If you are using Windows to =
generate your data you most likely are using Windows-1252 which is the =
default 8-bit character set for U.S. English in Windows. Windows = supports
many 8-bit encodings so you could be using something else too.
> > > > >
> > > > > Unicode is a character set not an encoding. There are =
multiple encodings the main ones being UTF-8, UTF-16, and UTF-32. You = can
use any of these for XML as well as non-Unicode encodings. For =
interoperability you should use Unicode preferably UTF-8.
> > > > >
> > > > > What comes out when the XML is parsed depends on the =
XML parser. XML is logically expressed in Unicode. The Windows XML = parsers
provide a Unicode interface. Other parsers could do = differently.
> > > > >
> > > > >Rich
> > > > >
> > > > >
> > > > > "Ellen K." <72322.1016@compuserve.com> wrote in message =
news:4o2g11pu048kafbdilg46u77vs5ls0be55@4ax.com...
> > > > > Our new enterprise system is going to be built around =
an Enterprise
> > > > > Service Bus. I don't have the full specs yet but as I =
understand it the
> > > > > main apps (starting with SalesForce) are going to be =
out on the internet
> > > > > and the Sonic ESB will be the messaging piece. There =
will be an
> > > > > Operational Data Store in house that will get updated =
every night on a
> > > > > batch basis from the main apps. =20
> > > > >
> > > > > My data warehouse will continue to be the data =
warehouse and will remain
> > > > > in house. The dimensions will stay the same but I =
might have to create
> > > > > separate measures for the data from the new apps and =
then create views
> > > > > to keep everything transparent to the users. =20
> > > > >
> > > > > I'm thinking if we're going to have an ODS in house =
already, I may as
> > > > > well do the ETL from there. But I'm worrying that the =
new data will
> > > > > probably be unicode (because Java defaults to that and =
SalesForce is
> > > > > written in Java). Right now I am storing everything =
(except our blobs
> > > > > of course) in 8-bit characters. =20
> > > > >
> > > > > Anyone here who's up on this stuff, can the XML that =
goes back and forth
> > > > > convert between unicode and 8-bit characters, or am I =
gonna have to
> > > > > redefine all my data? For example, if unicode data is =
put into an XML
> > > > > document that specifies UTF-8, what comes out when the =
document is
> > > > > parsed? How about vice versa? If this is too =
simplistic to work, what
> > > > > is needed?
> > > > >
> > > > > (We actually have no substantive need for unicode -- we =
are bilingual
> > > > > Spanish but all the special Spanish characters exist in =
the ascii
> > > > > character set.)
------=_NextPart_000_0A18_01C51857.402030C0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.3790.1289" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2> I don't understand why =
oracle using=20
UTF-8 wouldn't work and oracle using UTF-16 would. That sounds = like
an=20
oracle problem.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> There are two XML issues I =
see.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> One, and the only bug in =
what we have=20
discussed, is that the encoding declared in the ?xml PI must match the =
actual=20
encoding of the file. You can use any encoding that is supported = as
long=20
as your XML document is correctly encoded in whatever is =
declared.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> The second issue is what =
encodings=20
does your software support. I believe all XML implementations to =
claim=20
compliance must support UTF-8 and UTF-16. Most should support =
more. =20
I haven't tried Microsoft SQL Server but I would expect it to handle any = of
the=20
encodings with support installed on that host machine. Windows =
supports=20
many encodings. I just checked my machine and see more than 100 =
supported=20
encodings.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> My suggestion is to stick =
with UTF-8=20
for the stuff you generate if you can. For what you have to = consume
from=20
other software simply has to work. If not you can go back to the =
folks=20
responsible for creating it and find a way to make it = valid.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Rich</FONT></DIV>
<DIV> </DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ellen K." <<A=20
=
href=3D"mailto:72322.1016@compuserve.com">72322.1016@compuserve.com</A>&g=
t;=20
wrote in message <A=20
=
href=3D"news:qt9l115cio5kc8ijjumaubpvb6n9ig50ir@4ax.com">news:qt9l115cio5=
kc8ijjumaubpvb6n9ig50ir@4ax.com</A>...</DIV>Argggh,=20
I replied from work using Dale's mirror, it doesn't show up<BR>here,=20
waitaminnit...<BR><BR>OK, here we go:<BR><BR>First of all I have to =
say you=20
have once again earned my eternal<BR>gratitude, I am so glad you are=20
here. :)<BR><BR>I still have to make a decision regarding =
the=20
standard I want to<BR>request. Are you saying that if for =
example I get=20
XML generated by say<BR>SalesForce with UTF-8 specified and it =
includes these=20
characters, I<BR>would not have a problem? Stuff I write myself =
I'm not=20
worried about<BR>because I have the opportunity to tweak it, what I'm =
worried=20
about is<BR>what the ESB will try to feed my databases. Since =
even the=20
hand-typed<BR>XML was accepted when UTF-16 was specified, I'm kind of =
leaning=20
toward<BR>that, especially since the Oracle guy told me that the TJ=20
accounting<BR>manager used to complain that the Spanish characters =
weren't=20
coming<BR>out on reports when we were on Oracle 8.x which used UTF-8 =
but as=20
soon<BR>as we moved to 9.x which uses UTF-16 there were no more=20
problems. What<BR>(if any) do you see as a potential downside to =
UTF-16?<BR><BR>Thanks again. =20
:)<BR> <BR> <BR><BR>On Mon, 21 Feb 2005 00:24:53 -0800, =
"Rich"=20
<@> wrote in message<BR><<A=20
=
href=3D"mailto:42199a9e@w3.nls.net">42199a9e@w3.nls.net</A>>:<BR><BR>&=
gt; =20
The problem is not that UTF-8 won't work for what you call Spanish=20
characters. UTF-8 can encode anything that you consider a=20
character. The problem is that when these characters are present =
they=20
are not being encoded in UTF-8. There are two straight forward =
solutions=20
I see. One is to encode the XML correctly in UTF-8. The =
other is=20
to encode the XML in the Windows ANSI encoding I suspect you are using =
and to=20
tag it correctly. On a Windows U.S. English system this would be =
"Windows-1252". I would expect SQL Server to support this. =
Other=20
applications may or may not. You could also use UTF-16 as long =
as you=20
generate your XML in UTF-16. I don't know if this is simple for =
your=20
application or not. If you are using VB 7.0 it should=20
be.<BR>><BR>>Rich<BR>><BR>> "Ellen K." <<A=20
=
href=3D"mailto:72322.1016@compuserve.com">72322.1016@compuserve.com</A>&g=
t;=20
wrote in message <A=20
=
href=3D"news:of2j11lqf4r4h1dsnvok8i1dv7c9e3rlb2@4ax.com">news:of2j11lqf4r=
4h1dsnvok8i1dv7c9e3rlb2@4ax.com</A>...<BR>> =20
Well. You just helped me learn a lot. For one =
thing, I=20
guess I<BR>> thought that because the Spanish characters can =
be=20
expressed as 8 bits<BR>> they were ASCII. =20
<BR>><BR>> I just made a little test stored procedure =
taking an=20
XML document as a<BR>> parameter, created the document =
manually in=20
Notepad with UTF-8 specified<BR>> in the header and tried =
including=20
some of the Spanish characters... and<BR>> it failed. =
SQL=20
Server could not execute sp_xml_preparedocument because<BR>> =
"an=20
invalid character was found in text content". Just to make =
sure<BR>> that was the problem I substituted non-Spanish =
characters=20
for the<BR>> Spanish ones and it executed fine. =
However, I can=20
manually type the<BR>> text with the Spanish characters into =
the=20
varchar field if I open the<BR>> table in EnterpriseManager =
and SQL=20
Server is perfectly happy. OTOH, if<BR>> I specify =
UTF-16, I=20
get "Switch from current encoding to specified<BR>> encoding =
not=20
supported." Next thing I tried was cloning the sproc=20
to<BR>> write to the table with the nvarchar column, still no =
joy,=20
same error<BR>> message... but on changing the datatype of =
the input=20
parameter from text<BR>> to ntext it worked fine. BUT =
here's=20
the surprise (OK, to me it was a<BR>> surprise): If I =
again=20
clone the sproc to point to the table with the<BR>> varchar =
column,=20
but leave the input parameter as ntext and specify<BR>> =
UTF-16 in the=20
document header, it works. In other words, a varchar =
(and<BR>> =20
presumably a char) column can successfully accept unicode data=20
even<BR>> though char and varchar are explicitly defined as=20
non-unicode datatypes!<BR>><BR>> Now I have to understand =
whether=20
I have a problem at work. I never<BR>> =
experienced this=20
problem in real life because none of the data we<BR>> =
currently send=20
using XML includes any of the Spanish characters. =
Is<BR>> the=20
problem only going to occur if the XML document is constructed=20
using<BR>> the concatenated-string method? Or =
would it=20
happen any time an XML<BR>> document specified as UTF-8 =
included=20
Spanish characters? (The data<BR>> sent by =
SalesForce to=20
the ODS is likely to include Spanish characters,<BR>> but it =
probably=20
creates the XML some other way.) Do I need to tell =
the<BR>> =20
consulting outfit to specify all XML as UTF-16? =
<BR>><BR>> =20
For the ETL from the ODS to the data warehouse I am not planning to=20
use<BR>> Sonic, but rather probably to link the databases and =
use a=20
bunch of<BR>> stored procedures controlled by some VB code, =
IOW I=20
will not need XML<BR>> because all the extract sprocs will =
look like=20
INSERT INTO....SELECT<BR>> FROM.<BR>><BR>> I =
don't yet=20
understand why UTF-8 can't work for the Spanish<BR>> =
characters...=20
(unless it only doesn't work when the characters are<BR>> =
manually=20
typed into the document). If I correctly understand =
the<BR>> =20
document to which you referred me, an 8-bit character can't fit in=20
one<BR>> UTF-8 byte because the first bit is reserved for =
indicating=20
which is the<BR>> first byte of a UTF-8 multi-byte =
character. =20
(This was your point about<BR>> not greater than =
0x7F.) =20
But why wouldn't it just make two bytes out of<BR>> the =
Spanish=20
characters then? The documentation says UTF-8 =
uses<BR>> =20
multiple bytes for the characters that it can't fit into one =
byte. =20
<BR>><BR>> ???<BR>><BR>><BR>><BR>> On =
Sun, 20=20
Feb 2005 13:10:40 -0800, "Rich" <@> wrote in =
message<BR>> =20
<<A=20
=
href=3D"mailto:4218fc91@w3.nls.net">4218fc91@w3.nls.net</A>>:<BR>><=
BR>> =20
> The Spanish accented characters are not part of =
ASCII. =20
They are part of Windows calls ANSI of which ASCII is the subset (0x00 =
to=20
0x7F). Any character in the 0x80 to 0xFF range is not compatible =
between=20
ANSI and UTF-8.<BR>> ><BR>> =
>Rich<BR>> =20
><BR>> > "Ellen K." <<A=20
=
href=3D"mailto:72322.1016@compuserve.com">72322.1016@compuserve.com</A>&g=
t;=20
wrote in message <A=20
=
href=3D"news:7ouh119ivmuk26icg3mqqqk2ss1lfm5c10@4ax.com">news:7ouh119ivmu=
k26icg3mqqqk2ss1lfm5c10@4ax.com</A>...<BR>> =20
> Should not have any non-ASCII characters, as previously =
noted all=20
the<BR>> > special Spanish characters are available =
in the=20
ASCII character set.<BR>> > And since the company is =
built=20
on our understanding of the Hispanic<BR>> > market, =
I don't=20
see any use of, say, pictograph-based languages in the<BR>> =20
> foreseeable future. If 10 years down the road =
something=20
like that<BR>> > happens, well, by then we will no =
longer=20
need compatibility with the<BR>> > current legacy =
system=20
because it will long since have been replaced.<BR>> =20
><BR>> > On Sun, 20 Feb 2005 12:52:25 -0800, =
"Rich"=20
<@> wrote in message<BR>> > <<A=20
=
href=3D"mailto:4218f849$1@w3.nls.net">4218f849$1@w3.nls.net</A>>:<BR>&=
gt; =20
><BR>> > > From what you describe =
below,=20
if the values you emit to XML have non-ASCII characters I would expect =
you to=20
have a problem.<BR>> > ><BR>> > =
>Rich<BR>> > ><BR>> > =
> =20
"Ellen K." <<A=20
=
href=3D"mailto:72322.1016@compuserve.com">72322.1016@compuserve.com</A>&g=
t;=20
wrote in message <A=20
=
href=3D"news:eanh11h4vv6b9v21fiaounii3f5dunjl3g@4ax.com">news:eanh11h4vv6=
b9v21fiaounii3f5dunjl3g@4ax.com</A>...<BR>> =20
> > On Sat, 19 Feb 2005 23:32:37 -0800, "Rich" =
<@>=20
wrote in message<BR>> > > <<A=20
=
href=3D"mailto:42183ccd@w3.nls.net">42183ccd@w3.nls.net</A>>:<BR>>&=
nbsp;=20
> ><BR>> > > > =
The UTF=20
in UTF-8/16/32 stands for Unicode Transformation Format. You can =
find=20
these defined in section 2.5 of <A=20
=
href=3D"http://www.unicode.org/versions/Unicode4.0.0/ch02.pdf">http://www=
.unicode.org/versions/Unicode4.0.0/ch02.pdf</A>.<BR>> =20
> ><BR>> > > THANK YOU SO=20
MUCH!!! :)<BR>> > > =20
><BR>> > > > It's not =
clear to me=20
how you are creating the XML from the templates. If ANSI data is =
emitted=20
into an XML document declared as UTF-8 then you would have problems =
only for=20
non-ASCII characters. UTF-8 and Windows-1252 are identical for =
0x00 to=20
0x7F which is ASCII in both.<BR>> > =
><BR>> =20
> > I don't have a copy of a template here at home, =
but I=20
have them create<BR>> > > it by string=20
concatenation because that seems to be the only way to =
be<BR>> =20
> > able to have CDATA attributes, which I have to =
have=20
because in the<BR>> > > legacy data=20
numeric-appearing identifiers are actually 10-character<BR>> =20
> > strings with leading spaces, and if these are =
not=20
specified as CDATA<BR>> > > the spaces go =
lost even=20
with "xml:space=3D"preserve"" included in the<BR>> > =
> header. Here is a code snippet from one of my apps =
that=20
creates an XML<BR>> > > document which is =
passed as=20
a parameter to a SQL Server stored<BR>> > > =
procedure:<BR>> > ><BR>> > =
> =20
> strXM =3D "<?xml version =3D" =
& Chr(34)=20
& "1.0" & Chr(34) & " encoding=3D" & Chr(34) =
& "UTF-8"=20
& Chr(34) & "?>" & vbCrLf _<BR>> > =
> =20
> & "<ROOT =
xml:space=3D"=20
& Chr(34) & "preserve" & Chr(34) & ">" &=20
vbCrLf<BR>> > > ><BR>> =
> =20
> > Do While Not =
.EOF<BR>> =20
> > > =
strXM =3D=20
strXM & "<M><A>" & !Ofc &=20
"</A><B><![CDATA[" & !Contract &=20
"]]></B><C>" & !TCode & "</C><D>" =
&=20
!Date & "</D>" _<BR>> > > =20
=
> &nb=
sp; =20
& "<E><![CDATA[" & !TransNo &=20
"]]></E></M>" & vbCrLf<BR>> > =
> =20
> .MoveNext<BR>> =
> > > =
Loop<BR>> =20
> > ><BR>> > > =20
> strXM =3D strXM &=20
"</ROOT>"<BR>> > ><BR>> > =
> (The vbCrLf's are there so if there is a problem the =
document can=20
be<BR>> > > printed to a text file and be =
easier=20
for humans to read -- SQL Server<BR>> > > =
ignores=20
them. The single-character aliases for entity and=20
attribute<BR>> > > names are for =
performance -- for=20
most of the stuff we use these for it<BR>> > =
> =20
doesn't really matter because we are only sending a few rows, but=20
the<BR>> > > first time I did it it was for =
something that was sending about 5000<BR>> > =
> rows=20
and there it made a huge difference, so I stuck with it. =20
We<BR>> > > comment both the front-end code =
and the=20
stored procedure with the<BR>> > > mappings =
of=20
these aliases.)<BR>> > ><BR>> > =
> > I do not know how SQL Server maps from =
char to=20
nchar, specifically what conversion is performed. Also, in some =
(maybe=20
all released) versions of SQL Server nchar and nvarchar are encoded in =
UCS-2. UCS-2 is a 16-bit encoding like UTF-16. It dates =
back to=20
when Unicode was defined as having 2**16 characters instead of the =
2**20+ that=20
it has now. You can not express characters >=3D U+10000 in =
UCS-2 not=20
that you care about these.<BR>> > ><BR>> =
> > Thankfully, no. :)<BR>> =
> =20
> ><BR>> > > > I =
don't=20
know if whether those systems you describe being written in java make =
a=20
difference. They can do what they want. The native java =
string is=20
Unicode though I don't remember if it is UCS-2 or UTF-16. My =
guess is=20
that it was once the former and is now the latter. One of the =
documents=20
on this on sun's site suggests that java used UCS-2 until the recently =
released 1.5 which is the first to use UTF-16.<BR>> =
> =20
><BR>> > > The Java native string being =
unicode=20
is exactly what made me start<BR>> > > =
worrying --=20
when I was learning Java a couple of years ago (because =
I<BR>> =20
> > wanted to port an app to it so as to be able to =
run it=20
right on the Unix<BR>> > > box where the =
Oracle=20
database was) I was horrified the first time I<BR>> =
> =20
> tried reading back what I had written to a text file when I =
saw=20
spaces<BR>> > > between all the=20
characters.<BR>> > > ><BR>> =
> =20
> >Rich<BR>> > > =
><BR>> =20
> > > "Ellen K." <<A=20
=
href=3D"mailto:72322.1016@compuserve.com">72322.1016@compuserve.com</A>&g=
t;=20
wrote in message <A=20
=
href=3D"news:aqag115606i9g8bmh3lst66une1f1sotth@4ax.com">news:aqag115606i=
9g8bmh3lst66une1f1sotth@4ax.com</A>...<BR>> =20
> > > UTF-8 is unicode?!? =
Sheesh, all=20
this time I thought it meant 8-bit.<BR>> > =
> =20
> In fact I could swear I read that somewhere.<BR>> =20
> > ><BR>> > > =
> My=20
question was coming from the database perspective, where I always=20
use<BR>> > > > char and varchar, =
as=20
opposed to nchar and nvarchar. I give the<BR>> =
> =20
> > front-end guys little templates for creating the =
XML=20
documents for all<BR>> > > > my =
SQL Server=20
stored procedures that take XML input, and I always<BR>> =
> =20
> > specify UTF-8 in the header... and my char and =
varchar=20
columns always<BR>> > > > end up =
normal,=20
so since you're now telling me UTF-8 is really unicode, =
I<BR>> =20
> > > guess that would answer my question =
for XML=20
data I would be getting from<BR>> > > =
> =20
the apps...? Or would the answer be different if the =
incoming XML is<BR>> > > > some =
other=20
encoding?<BR>> > > ><BR>> =
> =20
> > To simulate getting nvarchar data from =
somewhere, I just=20
tried creating<BR>> > > > two =
dummy=20
tables, one with an nvarchar column and the other with a<BR>> =
> > > varchar column, typed stuff into the =
nvarchar=20
one, then inserted to the<BR>> > > =
> =20
varchar one select from the nvarchar one and it looks normal. =20
<BR>> > > ><BR>> > =
> =20
> If all this means I was worrying about nothing,=20
excellent! OTOH, is<BR>> > > =
> =20
there something I should be worrying about that I didn't =
ask?<BR>> =20
> > ><BR>> > > =
> The=20
only pieces whose names I know so far are Sonic and SalesForce,=20
both<BR>> > > > of which are =
written in=20
Java, if that makes any difference. I know<BR>> =
> =20
> > there is at least one other external piece but I =
think=20
that is the next<BR>> > > > =20
phase.<BR>> > > ><BR>> =
> =20
> > On Sat, 19 Feb 2005 21:37:15 -0800, "Rich" =
<@>=20
wrote in message<BR>> > > > <<A =
=
href=3D"mailto:421821c1$1@w3.nls.net">421821c1$1@w3.nls.net</A>>:<BR>&=
gt; =20
> > ><BR>> > > =
> =20
> You need to be more specific than "8-bit =
characters". =20
There are many 8-bit character encodings. If you are using =
Windows to=20
generate your data you most likely are using Windows-1252 which is the =
default=20
8-bit character set for U.S. English in Windows. Windows =
supports many=20
8-bit encodings so you could be using something else =
too.<BR>> =20
> > > ><BR>> > =
> =20
> > Unicode is a character set not an =
encoding. =20
There are multiple encodings the main ones being UTF-8, UTF-16, and=20
UTF-32. You can use any of these for XML as well as non-Unicode=20
encodings. For interoperability you should use Unicode =
preferably=20
UTF-8.<BR>> > > > =
><BR>> =20
> > > > What comes out when =
the XML=20
is parsed depends on the XML parser. XML is logically expressed =
in=20
Unicode. The Windows XML parsers provide a Unicode =
interface. =20
Other parsers could do differently.<BR>> > =
> =20
> ><BR>> > > > =20
>Rich<BR>> > > > =
><BR>> =20
> > > ><BR>> > =
> =20
> > "Ellen K." <<A=20
=
href=3D"mailto:72322.1016@compuserve.com">72322.1016@compuserve.com</A>&g=
t;=20
wrote in message <A=20
=
href=3D"news:4o2g11pu048kafbdilg46u77vs5ls0be55@4ax.com">news:4o2g11pu048=
kafbdilg46u77vs5ls0be55@4ax.com</A>...<BR>> =20
> > > > Our new enterprise system =
is going=20
to be built around an Enterprise<BR>> > > =20
> > Service Bus. I don't have the full specs =
yet but=20
as I understand it the<BR>> > > > =20
> main apps (starting with SalesForce) are going to be out on =
the=20
internet<BR>> > > > > and =
the=20
Sonic ESB will be the messaging piece. There will be=20
an<BR>> > > > > =
Operational Data=20
Store in house that will get updated every night on a<BR>> =
> =20
> > > batch basis from the main apps. =
<BR>> > > > ><BR>> =
> =20
> > > My data warehouse will continue to be =
the=20
data warehouse and will remain<BR>> > > =
> =20
> in house. The dimensions will stay the same but I =
might have=20
to create<BR>> > > > > =
separate=20
measures for the data from the new apps and then create =
views<BR>> =20
> > > > to keep everything =
transparent to=20
the users. <BR>> > > > =
><BR>> > > > > I'm =
thinking if=20
we're going to have an ODS in house already, I may as<BR>> =
> =20
> > > well do the ETL from =
there. But=20
I'm worrying that the new data will<BR>> > =
> =20
> > probably be unicode (because Java defaults to =
that and=20
SalesForce is<BR>> > > > =
> =20
written in Java). Right now I am storing everything (except our=20
blobs<BR>> > > > > of =
course) in=20
8-bit characters. <BR>> > > =
> =20
><BR>> > > > > Anyone =
here=20
who's up on this stuff, can the XML that goes back and =
forth<BR>> =20
> > > > convert between unicode =
and 8-bit=20
characters, or am I gonna have to<BR>> > > =20
> > redefine all my data? For example, =
if=20
unicode data is put into an XML<BR>> > > =
> =20
> document that specifies UTF-8, what comes out when the =
document=20
is<BR>> > > > > =
parsed? How=20
about vice versa? If this is too simplistic to work, =
what<BR>> =20
> > > > is needed?<BR>> =20
> > > ><BR>> > =
> =20
> > (We actually have no substantive need for =
unicode -- we=20
are bilingual<BR>> > > > =
> =20
Spanish but all the special Spanish characters exist in the=20
ascii<BR>> > > > > =
character=20
set.)<BR></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_0A18_01C51857.402030C0--
--- BBBS/NT v4.01 Flag-5
* Origin: Barktopia BBS Site http://HarborWebs.com:8081 (1:379/45)
|