XML special character/encoding problem
Hi
I would like to store XML in a MSSQL database into a column with the datatype xml.
It seems like the xml datatype in an xMII transaction allways is stored with encoding type UTF-8
and the MSSQL xml datatype is UTF-16. This gives me some problem with special characters when inserting into the MSSQL database (in the example below is the MSSQL datatype xml):
INSERT INTO
VALUES
The error returned is this:
"com.microsoft.sqlserver.jdbc.SQLServerException: XML parsing: line 1, character 62, illegal xml character"
If I replace the 'ä' with a normal 'a' the command executes ok.
I am currently using a workaround that looks like this, when setting the parameter in my transaction:
stringreplace(Local.test, " encoding=" & doublequote & "UTF-8" & doublequote, "")
But I was hoping I could get rid of the stringreplace.
Is there a solution / recommended way of doing this?
Best Regards
Simon Bruun
Edited by: Simon Bruun on Mar 4, 2011 10:43 AM
I solved this. I convert to Unicode UTF-8
Similar Messages
-
Character encoding problem by Gmail set up as exchange account on IOS mail
It was maybe asked before but I could not find any solution. If someone can help I would appreciate it...
If I set up my gmail, which I use very heavily, as Gmail on the IOS mail installation it would be set up as IMAP and does not push the emails. If I choose it to install as exchange account via m.google.com everything is OK and I get my mails instantly. But the way over exchange disturbs because of the character encoding problem. IOS mail does not show me the turkish or some german characters like "ü" and the mail is almost not readable... By version 1 also as IMAP there is no problem with the characters but I must start IOS mail everytime to see if I have new mail...
Does anyone know a solution for it?
Thanks...
MelBut I cannot set the the gmail app as standart email program, or? I mean if I want to send a page on safari and click send via email, the mail.app would start and not the gmail.app.... I am using Iphone since a few weeks and as far as I know a customisation is not possible.
-
Request.getParameter(): special character handling problem
Hello, there:
This should be an easy question for the gurus in here.
I use a string attached to the url as the parameter string, which includes spaces. the system automatically converts them to %20, but when I receive them in my servlet using request.getParameter, a special character, Â appears; I couldn't proceed with it.
I suppose this is a common problem but seems that I didn't find topics about it on this forum.
So anyone can help? Any encoder/decoder APIs to handle it?
Thanks a lot,
Swayhi,
escape can solve ur problem
use js function to submit form like
function subForm()
var any_spcl_value ="kdfhjdf$%@#$% 2FGSFG @%@#%@# V";
mainForm.action = "index.jsp?value="+ escape(any_spcl_value);
mainForm.submit();
and use request.getParameter("value");
u ll get kdfhjdf$%@#$% 2FGSFG @%@#%@# V as it is.
AE -
Hi, I'm using the proxy generated by UDS for XML Server published service object. I have some problems with strings return types with some locales ( e.g:spanish ).
How can I set the XML Server response character encoding to avoid this problem?This tech note will help:
http://sunsolve.sun.com/pub-cgi/retrieve.pl?doc=fsunone%2F7717&zone_110=7717%2A%20
ka -
XML to DataGird encoding problem
XML is in windows-1250 encoding (beacuse special character
čćžšđ)
when I load XML into DataGrid there are no special chars like
čćžšđI solved this. I convert to Unicode UTF-8
-
Generate XML - Special Character in data causing error
Hello,
I have a procedure written using DBMS_XMLGEN to create xml output. A problem that I am running into is some of my data has an eacute in it. How can I code the XML to account for this and any other weird characters that may exist?
(ie - i need to be able to specify the encoding part of ?xml version=1.0 encoding=ISO-8859-1?)
Here is an excerpt of what i have so far...the results are fine until I run to include the data with the eacute. Then nothing is generated at all. I tried .convert, but I don't know if that's what I need, or if I am calling it correctly.
Thanks!
Janel
ctx := dbms_xmlgen.newContext(rc_data);
-- set name of root element --
dbms_xmlgen.setRowsetTag(ctx, 'XXFA10022');
-- set name of element separating all rows --
-- default is ROW --
dbms_xmlgen.setRowTag(ctx, 'G_DATA');
-- generate XML document --
xml := dbms_xmlgen.getXml(Ctx);
xml := dbms_xmlgen.convert(xml, dbms_xmlgen.ENTITY_ENCODE);
i := dbms_xmlgen.getNumRowsProcessed(ctx);
dbms_xmlgen.closeContext(Ctx);
apps.fnd_file.put_line(apps.fnd_file.log, 'rows processed -' || i);
apps.fnd_file.put_line(apps.fnd_file.log, 'close');
apps.fnd_file.put_line(apps.fnd_file.log, xml);
apps.fnd_file.put_line(apps.fnd_file.output, xml);
-- free clob content --
dbms_lob.freetemporary(xml);No. There are no XML components that will clean up malformed XML. Your options are to go to whoever sent you that document and tell them that their XML is malformed and that in future they should not do that, or to write your own component to clean up the malformed XML. Since that would involve more work than writing a full XML parser, I don't recommend the second option.
-
Character encoding problem using XSLT and Tomcat on Linux
Hi,
I have an application running on a Tomcat 4.1.18 application server that applies XSLT transformations to DOM objects using standard calls to javax.xml.transform API. The JDK is J2SE 1.4.1_01.
It is all OK while running on a development enviroment (which is Windows NT 4.0 work station), but when I put it in the production enviroment (which is a red hat linux 8.0), it comes up with some kind of encoding problem: the extended characters (in spanish) are not shown as they should.
The XSL stylesheets are using the ISO-8859-1 encoding, but I have also tried with UTF-8.
These stylesheets are dynamicly generated from a JSP:
// opens a connection to a JSP that generates the XSL
URLConnection urlConn = (new URL( xxxxxx )).openConnection();
Reader readerJsp = new BufferedReader(new InputStreamReader( urlConn.getInputStream() ));
// Gets the object that represents the XSL
Templates translet = tFactory.newTemplates( new StreamSource( readerJsp ));
Transformer transformer = translet.newTransformer();
// applies transformations
// the output is sent to the HttpServletResponse's outputStream object
transformer.transform(myDOMObject, new StreamResult(response.getOutputStream()) );Any help would be appreciated.Probably you need to set your LANG OS especific environment variable to spanish.
Try adding this line:
export LANG=es_ES
to your tomcat/bin/catalina.sh, and restart tomcat.
It should look like this:
# OS specific support. $var _must_ be set to either true or false.
cygwin=false
case "`uname`" in
CYGWIN*) cygwin=true;;
esac
export LANG=es_ES
# resolve links - $0 may be a softlink
PRG="$0"
.(BTW, keep using ISO-8859-1 encoding for your XSL)
HTH
Un Saludo! -
c:import character encoding problem (utf-8)
Aloha @ all,
I am currently importing a file using the <c:import> functionallity (<c:import url="module/item.jsp" charEncoding="UTF-8">) but it seems that the returned data is not encoded with utf-8 and hence not displayed correctly. The overall file header is:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=E67F9DAF44C7F96C0725652BEA1713D8;
Content-Type: text/html;charset=UTF-8
Content-Length: 6861
Date: Thu, 05 Jul 2007 04:18:39 GMT
Connection: close
I've set the file-encoding on all pages to :
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page pageEncoding="UTF-8"%>
but the error remains... is this a known bug and is there a workaround?Partially, yes. It turns out that I created the documents in eclipse with a different character encoding. Hence the entire document was actually not UTF-encoded...
So I changed each document encoding in Eclipse to UTF and got it working just fine... -
Character encoding problem in deployed version
Hello,
I developed an ADF/jspx application in JDeveloper. When I'm running it in the embedded OC4J or the stand-alone OC4J, everything works well.
But when I deploy it into OAS 10.1.3 and run it, the special characters (in my german case for example "ü", "ö" and so on) are not shown. Instead some kind of place holder is displayed.
I checked the project's settings and parameters in web.xml and the jspx's, and all are set same to windows-1252. The NLS-LANG parameter in the registry of the server is also set to WE8MSWIN1252 (seems to be ok in my opinion).
Is there any further "place" for me to check the used encoding of OAS when displaying deployed pages?
Thank you very much!
SebastianI have just solved the problem.
In my servlet I had to add :
request.setCharacterEncoding("UTF-8");And thats it. -
XML data - charset encoding problem
Hello all,
I am facing an issue on charset encoding. My requirement is to send an XML and read the the output XML to display the output. The output XML is encoded in "ISO-8859-1" and we are retrieving/reading it in "UTF-8". But some special characteres in the output XML are appearing as it is.
Could some one let me know on how to obtain the desired characters.
Code snippet while reading the XML:
BufferedReader inStream = null;
BufferedWriter outStream = new BufferedWriter(new OutputStreamWriter(connection.getOutputStream(),"UTF-8"));
inStream =
new BufferedReader(new InputStreamReader(inputStream,"UTF-8"));
Thanks & regards,
SharathHi Sharath,
To read the XML file use the following. Dont mention the character set during reading it.I hope it will help you.
XML file(emp.xml)
<?xml version="1.0" encoding="ISO-8859-1"?>
<Emp>
<EmpDetails>
<firstname>Sarbari</firstname>
<lastname>Saha</lastname>
</EmpDetails>
<EmpDetails>
<firstname>Tumpa</firstname>
<lastname>Hazra</lastname>
</EmpDetails>
</Emp>
Java File
import java.io.*;
import javax.xml.parsers.*;
import org.w3c.dom.*;
import org.xml.sax.SAXException;
import org.w3c.dom.NamedNodeMap;
class ReadXML
public static void main(String args[])
try
String fileName="emp.xml";
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
Document doc = docBuilder.parse (fileName);
NodeList nodeList = doc.getChildNodes();
int nodeSize = nodeList.getLength();
for (int i=0;i<nodeSize;i++)
Node node = nodeList.item(i);
Element elm = (Element) node;
NodeList EmpDetailsList=elm.getElementsByTagName("EmpDetails");
int stNodeSize = EmpDetailsList.getLength();
System.out.println("NodeSize = "+stNodeSize );
for(int j=0;j<stNodeSize;j++)
Node nodeEmpdtl = EmpDetailsList.item(j);
Element elmDetails = (Element) nodeEmpdtl;
NodeList firstnameList=elmDetails.getElementsByTagName("firstname");
NodeList lastnameList=elmDetails.getElementsByTagName("lastname");
Node fnameNode=firstnameList.item(0);
System.out.print("Node : " + fnameNode.getNodeName());
System.out.println (" Value : "+((Element)fnameNode).getChildNodes().item(0).getNodeValue());
int lastnameNodeSize = lastnameList.getLength();
Node lnameNode=lastnameList.item(0);
System.out.print("Node : " + lnameNode.getNodeName());
System.out.println(" Value : "+((Element)lnameNode).getChildNodes().item(0).getNodeValue());
catch(ParserConfigurationException pce)
System.out.println("Inside ParserConfigurationException Exception");
catch(SAXException se)
System.out.println("Inside SAXException Exception");
catch(IOException ioe)
System.out.println("Inside IOException Exception");
Regards,
Mithu -
Character encoding problem in XSLT
I'm transforming dynamically created XMLs (data read from a MySql database) together with static XSLs (read directly from file system) into HTMLs with Xalan.
Everything works great on the development machine, but as soon as I put everything up on the production server, all special characters (such as ���) in the XSLs are replaced by '?'. The same characters in the XMLs work fine, only the ones directly in the XSLs are badly encoded.
I've stated encoding "ISO-8859-1" in the <?xml> as well as the <xsl:output> tags of the XSLs. Development and prodution machines should run the same j2sdk, as well as the same xalan et al libraries.
Does anyone have any ideas what I'm missing here? Are there any other places where I have to specify encoding? Or is the problem somewhere else? Grateful for any help.
Tommy SedinI'm sending the HTML directly to the browser.
There is difference between the output from development and production machines. For instance, when development produces "ä" the production system outputs "�" instead.
I've been looking through stuff, the only difference between the two systems that I can find are that production runs a slightly older version of Tomcat. Also, the configuration files of the Tomcats aren't the same, but I couldn't find anything in there that should affect this (though I could be mistaken, I'm not very used to messing about with Tomcat).
It feels like there's just a tiny problem somewhere, like somewhere where I should set the encoding of the output or some such. I'm not sure where that problem is however. Any ideas?
Thank you,
Tommy Sedin -
CF8 MySQL character encoding problems
Having worked with a MySQL 5 database (latin1 charset) with
CF5 with no problems for a long time.
After migrating to CF8 I get question marks ("?") instead of
extended characters (like umlauts ÄÖÜ) when printing
database content to my web page.
The following commands are set in my Application.cfm:
<cfset SetEncoding("form", "ISO-8859-1")>
<cfset SetEncoding("url", "ISO-8859-1")>
<cfcontent type="text/html; charset="iso-8859-1">
My HTML content starts as follows:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="de" xml:lang="de" xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type"
content="text/html;charset=iso-8859-1" />
Environment is WinXP, CF8, default JVM, MySQL3 driver coming
with CF8. Tables are MyISAM format with latin1 character set and
collation.
I cannot use the MySQL4/5 driver so far, since this driver
seems to enforce the STRICT database mode, which collides with some
database content (NULL values got saved as 0000-00-00 etc. as this
project has startet as a MySQL3 database many years ago). (BUT:
MySQL4/5 driver seems to work fine with above settings
I've already tried several combinations of
useUnicode=false;characterEncoding=iso-8859-1;characterSetResults=iso-8859-1
parameters in the "connection string" box of the data source (with
either ";" or "&" as separator) - to no avail.
Any chance I get it up running with the MySQL3 driver?
thanks for any help
Bernhardquote:
Originally posted by:
brahms_x01
We have the same problem since upgrading to CF 8. I have
found out, that it seems to depend on the encoding type of the
form. <cfform action="rezensent_update.cfm" method="post">
works fine but as soon as we use <cfform
action="rezensent_update.cfm" method="post"
enctype="multipart/form-data"> we get the same problem.
while searching for a solution to my problem came across a
possible solution to your problem: Adobe somewhere writes that you
have to add some encoding information to the enctype parameter. I
don't know the URL of the article anymore, but IIRC it was an
official bulletin of Adobe for internationalization of ColdFusion
projects. Have a google for it.
Bernhard -
Special Character Encoding issue
Hi all
Am using OAS9i. i ve deployed a webservice. i submit a payload request data that has some unicode characters like "§". The data is base64binary encoded. The type of the element mentioned in the schema is base64binary. When i retrieve the payload in java implementation code the character is displayed as � in the console. Please advice how to fix this issue. I tried setting JVM option file.encoding=utf-8 it didnt work out.
Thanks
ShinyWhen you use an UDF and you have programmed a Sax parser, then make sure, that the parser works with the correct encoding. So when the result of the webservice is ISO-8859-1, then assign this to the parser.
In principle the encoding should be part of XML header. Make sure that the encoding of the response is the same as declared in XML header. -
We are using WebLogic 7.0 SP4 on Solaris 8 w/ jdk131_10. By default we don't specify
the "encoding" jsp-param of the jsp-descriptor in the weblogic.xml. The BEA documentation
says "If not set, this parameter defaults to the encoding for your platform."
Without setting this value, certain characters in our JSPs are converted just
fine in our test environment but become "weird" characters in our production environment.
Question 1: Where exactly is the encoding of the "platform" specified?
So I figured we just had to specify the encoding to be UTF8, right? Well when
we do that, everything is still fine in test but in production we get the following
exception when WebLogic tries to compile a JSP.
weblogic.utils.ParsingException: nested TokenStreamException: antlr.TokenStreamIOException
at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java:964)
at weblogic.servlet.jsp.JspParser.doit(JspParser.java:90)
at weblogic.servlet.jsp.JspParser.parse(JspParser.java:213)
at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:119)
at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:258)
at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:356)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:214)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:164)
at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:534)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:364)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:462)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5517)
at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:685)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3156)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2506)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:234)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:210)
Question 2: Any ideas why this exception is happening?
Conrad Armstrong wrote:
>
> We are using WebLogic 7.0 SP4 on Solaris 8 w/ jdk131_10. By default we
> don't specify the "encoding" jsp-param of the jsp-descriptor in the
> weblogic.xml. The BEA documentation says "If not set, this parameter
> defaults to the encoding for your platform." Without setting this value,
> certain characters in our JSPs are converted just fine in our test
> environment but become "weird" characters in our production environment.
>
> Question 1: Where exactly is the encoding of the "platform" specified?
>
> So I figured we just had to specify the encoding to be UTF8, right? Well
> when we do that, everything is still fine in test but in production we get
> the following exception when WebLogic tries to compile a JSP.
>
> weblogic.utils.ParsingException: nested TokenStreamException:
> antlr.TokenStreamIOException
> at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java:964)
> at weblogic.servlet.jsp.JspParser.doit(JspParser.java:90)
> at weblogic.servlet.jsp.JspParser.parse(JspParser.java:213)
> at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:119)
> at
>
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:258)
> at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:356) at
> weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:214) at
> weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:164) at
>
weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:534)
> at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:364)
> at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:462)
> at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
> at
>
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5517)
> at
>
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:685)
> at
>
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3156)
> at
>
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2506)
> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:234)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:210)
>
> Question 2: Any ideas why this exception is happening?
The platform encoding is the one returned by the system property
file.encoding => System.getProperty("file.encoding")
Probably you are developing on windows and deploying ('production') on
solaris? In that case the default file encodings on each os are different
and that may be causing the problem here. (On windows the default is cp1252
i think)
Typically, are all your jsps more or less iso-8859-1? then you can set this
encoding in weblogic.xml. I believe the default encoding on solaris is
"ISO-8859-1" (You can check this by writing a simple jsp which prints out :
Encoding : <%= System.getProperty("file.encoding") %>
Hope that helps.
Do let me know what you find
--Nagesh
-
Character encoding problems with weblogic stax implementation?
Hello all,
While using Stax to parse some XML, we encounter the following exception when the processor reaches the UTF-8 character C3 B1, ('ñ'):
Caused by: Error at Line:1, token:[CLOSETAGBEGIN]Unbalanced ELEMENT got:StudentRegistration expected:LastName
at weblogic.xml.babel.baseparser.BaseParser.parseSome(BaseParser.java:374)
at weblogic.xml.stax.XMLStreamReaderBase.advance(XMLStreamReaderBase.java:199)
We suspect that the processor's encoding might somehow be set to ANSI instead of UTF-8. I have read, in other posts, of a startup property related to web services:
-Dweblogic.webservice.i18n.charset=utf-8
However, this XML is not a web service request, but rather a file being read from disk after an MDB's onMessage() method is called.
Could this setting be affecting stax parsing outside of webservices? Any other ideas?
Thanks!As far as I know, we don't support changing outbound message encoding charset in 9.x. Both 8.x and 10.x support it. Check [url http://docs-stage/wls/docs100/webserv/client.html#wp230016]here
Maybe you are looking for
-
Adobe Photoshop Elements 10 DVD Menu
I read somewhere that I could make a DVD menu, in Adobe Elements for Adobe Premire Elements 10, but I am having troubling figuring out how to do so. Dose anyone know if there is a written or video tutorial for making a dvd template in Adobe Photoshop
-
Hi Is SCN provides T-shirts same like SDN.? I know SDN was giving once crossing respective milestones like 250, 1000, 500 pints... etc Did anybody got t-shirt recently..? Reg, Bhg
-
Start / Stop Window services
Hi, I would like to start and stop window services on remote computer. Do you know if there is a package API in java to do it? How can I do it? Thanks, Anat
-
Condition type with two varibles....
We are to set up some new condition types. We need it to be in percentage, and then we need to create a formula calculating the correct value. Our challenge is that we need for different percentage value having the system to calculate based on base v
-
Notice that I have a pending im appear in menu bar.
Is there a way to put pending ichat message on the menu bar listed above. I found one application but then I need to us it instead of Ichat which I am not prepared to do. It would look like the red icon above but list pending chat messages. I get mes