xml unicode problem

2005-03-10 Thread Manisha Sathe
I amon MSSQL 2K. The field i am using to store chinese character is defiles as 

chinesename nvarchar(50)

Using jsp file (meta tag set to UTF-8) to display form. User fill up the form and submit it. At backend i run servlet andinsert into table.When i insert the value i use statements like 

insertvalue (N'..'). 

When i view it using Enterprise Manager, i see some weird characters.Butstill when i use jsp file to retrive all data back,it shows on screen all correct. 

But the problem comes when i use these database values and create XML file. In XML file created i see the sameas what i see in Enterprise Manager. So PDF rendered also is showing same weird chars.

I know MSSQL uses UCS2 but i am specifying UTF-8 for my jsp ? Any clues on this pls ? How i can have my XML file properly created ?

regards
Manisha




		Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site! 

Re: xml unicode problem

2005-03-10 Thread Jeremias Maerki
Yes, this sounds very much like an encoding problem. UCS2 is definitely
not the same as UTF-8. What you need to do in your case is not clear
to me, however. It depends a lot from what the JDBC driver returns, how
you create the XML file etc. etc.

On 10.03.2005 10:05:47 Manisha Sathe wrote:
 I am on MSSQL 2K. The field i am using to store chinese character is defiles 
 as 
  
 chinesename nvarchar(50)
  
 Using jsp file (meta tag set to UTF-8) to display form. User fill up the form 
 and submit it. At backend i run servlet and insert into table. When i insert 
 the value i use statements like 
  
 insertvalue (N'..'). 
  
 When i view it using Enterprise Manager, i see some weird characters. But 
 still when i use jsp file to retrive all data back, it shows on screen all 
 correct. 
  
 But the problem comes when i use these database values and create XML file. 
 In XML file created i see the same as what i see in Enterprise Manager. So 
 PDF rendered also is showing same weird chars.
  
 I know MSSQL uses UCS2 but i am specifying UTF-8 for my jsp ? Any clues on 
 this pls ? How i can have my XML file properly created ?


Jeremias Maerki


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



unicode problem

2002-05-16 Thread Henrik Holle
hi,

i have an java string with an greek alpha letter.  i do not know how to
convert the java unicode string so that i can display
it with fop


i need something like:
fo:inline  font-family=Symbol  font-size=7pt#x03B1;/fo:inline



RE: unicode problem

2002-05-16 Thread Argyn Kuketayev
Unicode is Ok in your example. I guess, your issue is with fonts.

 -Original Message-
 From: Henrik Holle [mailto:[EMAIL PROTECTED]
 Sent: Thursday, May 16, 2002 10:46 AM
 To: [EMAIL PROTECTED]
 Subject: unicode problem
 
 
 hi,
 
 i have an java string with an greek alpha letter.  i do not 
 know how to
 convert the java unicode string so that i can display
 it with fop
 
 
 i need something like:
   fo:inline  font-family=Symbol  
 font-size=7pt#x03B1;/fo:inline
 


Re: unicode problem

2002-05-16 Thread J.Pietschmann
Henrik Holle wrote:
i have an java string with an greek alpha letter.  i do not know how to
convert the java unicode string so that i can display
it with fop
i need something like:
fo:inline  font-family=Symbol  font-size=7pt#x03B1;/fo:inline
You have at least two options:
1. Let the Java library write a stream in an encoding which
is understood by an XML parser. Look at the documentation for
java.io.OutputStreamWriter for this purpose. Create one with
UTF-8 or perhaps another UTF encoding, like
 w=new java.io.OutputStreamWriter(new FileOutputStream(f.xml),UTF-8)
 w.write(theString,0,theString.length());
Be sure to put an XML declaration in front with either
encoding=UTF-8 or no encoding specification at all (UTF-8
can be autodetected). There is an overwiev of character
encoding handling in Java on the package summary for java.lang.
2. Print the XML character references yourself. This isn't hard
(assuming your default character encoding is ASCII or an ASCII
extension like ISO-8859).
 for( int i=0;itheString.length();i++ ) {
  char c=theString.charAt(i);
  int ci=(int)c;
  if( ci=127 ) {
   System.out.print(c);
  } else {
   System.out.print(#+ci+;);
  }
 }
J.Pietschmann