Problem handling special characters while generating pdf
I have special char stored in DB when user pasted that on the screen. i will read and make the DOM and add as attribute. when i apply xslt transformer and send it to driver(FOP) . it gives following error.
FOPException; invliad character  in xml.
i tried couple things:
1.just created DOM with special character in it and using streamsource i ouputted into flat file. it converted special char into  this is not valid value in XML
2. i set outputformat to utf-8 & iso too it doesnt help(i gues i i have some way to set input file encoding it would help)
Thanks for your help in advance
my part of JPD file from where i am calling db method which query the records.
* @jpd:process process::
* <process name="loadContacts">
* <clientRequest name="Subscription" method="subscription"/>
* <perform name="Perform" method="CacheRecordType"/>
* <block name="Group">
* <onException name="OnException">
* <perform name="Perform" method="perform1"/>
* </onException>
* <doWhile name="Do While" condition="exprFunction0($rowsProcessed)">
* <perform name="Perform" method="perform"/>
* </doWhile>
* </block>
* </process>::
* @jpd:xquery prologue::
* define function exprFunction0(xs:int $rowsProcessed) returns xs:boolean {
* ($rowsProcessed <= 50) and
* ($rowsProcessed != 0)
public void perform() throws Exception
LoginResult loginResult=null;
String sforceId="";
SvcControl.ContactData[] contactData = null;
log.debug("Started Load Contact process=");
try{
log.debug("Started Load Contact process="+ SvcControl.getContactData().toString());
contactData = SvcControl.getContactData();
log.debug("Started Load Contact process="+ contactData.toString());
}catch(Exception e){
log.error("Caught exception:"+e.getMessage());
return;
if(contactData!=null){
Edited by: Pannar on Dec 4, 2008 10:45 PM
Similar Messages
-
Problems with special characters with XML/PDF printing
Hi,
Our setup:
Apex Listener 2.0.5
Oracle DB 11G
Weblogic
Apex 4.2.2
Various recent major browsers
We used this blog post so we could do some PDF printing with APEX Listener:
http://marcsewtz.blogspot.be/2013/04/pdf-printing-with-oracle-application.html
The problem is special characters. For example the "&" sign comes out as "%26amp;" when we export an XML.
Could anyone provide some insights of what we can do to fix this?
Regards,
JoniThis is a known bug.
https://support.oracle.com/epmos/faces/BugDisplay?_afrLoop=957905848396285&id=18282188&_afrWindowMode=0&_adf.ctrl-state=168vq5zhn3_233
The bug 18282188 has been fixed in Apex 4.2.5 version.
Upgrade the Apex version to 4.2.5 when it is available. -
Problems with special characters displaying in PDF when exported.
I have a very frustrating question. I've never had any problems with font and pdfs before switching to the operating system for Mac. Of course, they have Helvetica Neue pre-installed as a system font. The problem is, Bold doesn't work and is not an option. I've tried using Helvetica Neue (TT) but special character and punctuation disappear completely.
See below:
MЧnica PОrez
Unfortunately, that is supposed to say Monica Perez. There are supposed to be marks above the "o" and "e". Can anyone help me?Try copying your T1 Helvetica Neue font into the Applications/Indesign/Fonts folder. This will give you the complete family in Indesign overriding the system TT.
-
Error while generating PDF - in Bex Web
Hi Experts,
I am currently having the issue that I receive the error "Error while generating PDF" when using the "Print Version" functionality. This problem only occurrs for the Bex Web Query. I know that the ADS service is configured correctly- The webservice test is successful and other applications (Guided Procedures, MSS) also use it successfully.
Please see below the excerpt from the default trace:
A message was generated:
ERROR
Error while generating PDF
com.sap.ip.bi.webapplications.pageexport.PageExportRenderingRootNode PageExportRenderingRootNode_0001
Message: 28
Stack trace: java.lang.ArrayIndexOutOfBoundsException: 28
at com.sap.ip.bi.export.xfa.impl.SizeCalculator.getColumnSizes(SizeCalculator.java:178)
at com.sap.ip.bi.export.impl.ExportController.setSizes(ExportController.java:220)
at com.sap.ip.bi.export.impl.ExportController.calculateAndSetSizes(ExportController.java:611)
at com.sap.ip.bi.export.impl.ExportController.doExportPrep(ExportController.java:408)
at com.sap.ip.bi.export.impl.ExportController.convert(ExportController.java:336)
at com.sap.ip.bi.export.controller.ExportResult.createExport(ExportResult.java:58)
at com.sap.ip.bi.webapplications.pageexport.PageExportRenderingRootNode.createPDF(PageExportRenderingRootNode.java:453)
at com.sap.ip.bi.webapplications.pageexport.PageExportRenderingRootNode.doExport(PageExportRenderingRootNode.java:105)
at com.sap.ip.bi.webapplications.pageexport.PageExportRenderingRootNode.processRendering(PageExportRenderingRootNode.java:252)
at com.sap.ip.bi.webapplications.runtime.impl.Page.buildRenderingTree(Page.java:3809)
at com.sap.ip.bi.webapplications.runtime.impl.Page.processRenderingRootNode(Page.java:3867)
at com.sap.ip.bi.webapplications.runtime.impl.Page.processRendering(Page.java:3510)
at com.sap.ip.bi.webapplications.runtime.impl.Page.doProcessRequest(Page.java:3470)
at com.sap.ip.bi.webapplications.runtime.impl.Page.processRequest(Page.java:2489)
at com.sap.ip.bi.webapplications.runtime.controller.impl.Controller.doProcessRequest(Controller.java:892)
at com.sap.ip.bi.webapplications.runtime.controller.impl.Controller.processRequest(Controller.java:813)
at com.sap.ip.bi.webapplications.runtime.jsp.portal.services.BIRuntimeService.handleRequest(BIRuntimeService.java:456)
at com.sap.ip.bi.webapplications.runtime.jsp.portal.components.LauncherComponent.doContent(LauncherComponent.java:21)
at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)
at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:645)
at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753)
at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:240)
at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:522)
at java.security.AccessController.doPrivileged(Native Method)
at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:405)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:156)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
If you have any idea or clue it would be greatly appreciated.
Thanks in advance for every support,
JanHi Jan,
Most possible causes for encountering this issue are:
Possible cause:
- The ADS is installed on a plattform, that is currently not supported by SAP for ADS. Please check the avaliablity at: Product Availability Matrix
- Mixing of different Netweaver releases (NW04 and NW04s) -> This is unfortunatelly not possibble the J2EE engine release has to match with the ABAP stack release in order connect them properly.
- The ADS SP level does not match the J2EE engine SP level. -> Please update the software components to have the same support package level.
Hope this helps!!
Regards,
Arafat -
Error occurred while generating PDF. Reason: ERROR_PDF_CONVERSION
I get an error generating my PDF whenever someone's name has a special character's in their name such as accents and diacritics.
Is this a bug or how do I properly set the charset for the <cfhtmltopdf> tag. I didn't have this issue with Coldfusion 9 and cfdocument. Any help in this regard would be much appreciated.
version: Coldfusion 11 Update 3 on Windows Server 2008 R2 on IIS 7.5
SEE STACK TRACE BELOW
coldfusion.document.webkit.PDFgErrorHandler$ServiceManagerConversionException: Error occurred while generating PDF. at coldfusion.document.webkit.PDFgErrorHandler.handleConversionError(PDFgErrorHandler.java:1 88) at coldfusion.document.webkit.HttpPDFRequestHandler.requestPDFGeneration(HttpPDFRequestHandl er.java:113) at coldfusion.tagext.lang.HtmlToPdfTag.processPDFgRequest(HtmlToPdfTag.java:1331) at coldfusion.tagext.lang.HtmlToPdfTag.handlePDFgConversionRequest(HtmlToPdfTag.java:1466) at coldfusion.tagext.lang.HtmlToPdfTag.convertToPDF(HtmlToPdfTag.java:1413) at coldfusion.tagext.lang.HtmlToPdfTag.doEndTag(HtmlToPdfTag.java:1551) at cfcfhtmltopdf_createPDF2ecfm2090701148.runPage(c:\inetpub\wwwroot\myapp.com\includes\docs \cfhtmltopdf_createPDF.cfm:25) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:246) at coldfusion.tagext.lang.IncludeTag.handlePageInvoke(IncludeTag.java:736) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:572) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2986) at cfmethods2ecfm1148258034$funcSAVEPROXY.runFunction(c:\inetpub\wwwroot\myapp.com\cfc\docs\ methods.cfm:472) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:420) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:533) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:648) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:457) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2424) at cfmethods2ecfm1658643382$funcPROCESSSTEP.runFunction(c:\inetpub\wwwroot\myapp.com\cfc\mem berResults\methods.cfm:377) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:487) at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:383) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:95) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:334) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:533) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:648) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:457) at coldfusion.filter.ComponentFilter.invoke(ComponentFilter.java:251) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:480) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:42) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:142) at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:30) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:58) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.xml.rpc.CFCServlet.invoke(CFCServlet.java:156) at coldfusion.xml.rpc.CFCServlet.doPost(CFCServlet.java:348) at javax.servlet.http.HttpServlet.service(HttpServlet.java:646) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42 ) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:422) at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:199) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.jav a:607) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source)Does anyone have any suggestions?
I've tried:
adding charset meta tags to the top of my outputted HTML contents that comprise the PDF
I've tried adding the <cfprocessingdirective pageencoding="utf-8" /> but doesn't seem to help.
#encodeForHTML(pdfHTMLVariable)# and even just tried encoding the individual variables that contained the special characters but that didn't seem to help anything as encoding them still won't work I'm assuming if the Charset is mis-matched.
Does the <cfprocessingdirective pageencoding="utf-8"> just have to be within the CFC method or does it need to be within the <cfhtmltopdf> tag?
Any input or things to try would be much appreciated as this is a regression for our app.
**As a side note: I would still just use CFDOCUMENT, but there was a different issue where the images were outputting a RED X where the image is supposed to be. Which from what I have been able to uncover has something to do with the server certificate not being trusted or something. However, our SSL provider is listed in the ROOT Certificate Authorities so not sure what's going on with that. Those images were being output with cfimage action of writeToBrowser .
I'd really like to fix the encoding issue does this have anything to do with language packs or missing languages of that sort? My app displays the page just fine when the UTF-8 charset meta tag is set. -
Handling special characters in XML
Hi,
I am using Oracle 10g 'XMLType' datatype to store XML files. Before storing I parse the XML document using Java Xerces Parser. If it parses successfuly, then I perform some business rule execution based on XML file which was parsed. So till this stage there is no problems. But when XML file contains some special characters like copy-paste of some description from MS-Word document into XML tags, then Xerces parser will parse such characters with out any exceptions, but while inserting XML document, Oracle database just throws exception saying unable to handle special characters.. So how to avoid such exceptions or silent such exceptions with any specific settings respect to XMLType datatype in 10g DB.
Please advice!
Arvind Patil - INMonica--
In XI 2.0, we've noticed a number of issues processing special characters, primarily caused by the version of JCO that we're running. It sounds like SAP has spent some time in the past few months focusing on these errors, so make sure you're on the most recent patchlevels of all your middleware components, including any of the middleware libraries that BC uses. In XI, we had to update the 3 files that make up the RFC library and JCO library. SDM couldn't update the libraries for us -- we had to manually move the files to the right place.
Escaped XML characters like "&" """ """ were fixed as of JCO 2.0.10 (the current patchlevel on AIX/UNIX), the special character "'" is fixed in the next release, JCO 2.0.11, due out in a few weeks (hotfixes are available). I don't know the equivalent versions on other platforms. By default, XI 2.0 appears to have shipped with JCO 2.0.5. I would expect many XI 3.0 users to also be affected.
This may or may not apply to BC, because I don't know what BC uses to talk to SAP under the covers.
--Dan King
Capgemini -
To Handle Special Characters(Guideu0099 ) in MATMAS IDOC fields
Need to handle special characters like Guide, as an attached superscript in MATMAS02/05 IDOC field . The field name is TDLINE in E1MTXLM segment.
As a trial run when these special characters are pasted in the TDLINE field, it throws an error that "the input field contains prohibited characters"
Please let me know if there is any workaround for this.hi
good
go through these links, i hope these ll help you to solve your problem.
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CAGTFADMLO/CAGTFADMLO.pdf
http://www.erphome.net/wdb/upload/forum14_f_2908.doc
thanks
mrutyun^ -
"Error while generating pdf" error come when clicking on "Print Version "
Hello ,
When we execute Query in the Portal there is a 'Print version' button.
When you select it, it opens up print dialog and click OK
It is supposed to send 'pdf' stream to Web browser client on end user but it is not able to generate the pdf .
getting ' Error while generating pdf '
I am working on BI 7.0 .
The same is running fine in the Q Environment .But in Production we are getting this error .
Thanks ,
RahulHi,
I think this is an ADS error. This is a reason why pdf's are not working. We had the same issue.
You can check your installation:
Usage of SAP NetWeaver BI Diagnostics & Support Desk Tool
SAP Note Number: [937697|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_bw_bex/~form/handler%7b5f4150503d3030323030363832353030303030303031393732265f4556454e543d444953504c4159265f4e4e554d3d393337363937%7d]
Exceptions: Prerequisites for messages in the area BI Java
SAP Note Number: [1224043 |https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_bw_bex/~form/handler%7b5f4150503d3030323030363832353030303030303031393732265f4556454e543d444953504c4159265f4e4e554d3d31323234303433%7d]
Solution in our case was to update the SAPADS package to 7.00 17.1
Regards
Andreas -
"error while generating PDF" in WAD
Hi All,
I created Web Template BI7. In the requirement I have to export the report in PDF. I used Button group. When I have run the template and click to the PDF switch I am getting the export dialog after I click to 'ok' I am getting the error error while generating PDF". Please help me how to resolve this error. I am in between the development.
Thanks in Advance
RaviHi Ravi,
First make sure you on the latest patch level for the service pack. Forward the error to the Basis team and ask them to look into the logs. We had a same problem and doing the above 2 steps fixed it.
Thanks,
Ram. -
Custom Purchase Order template causes Error while generating PDF
The standard XSLFO works, my custom one errors:
History of the world:
1) I downloaded the XML Publisher thing for Word, installed it no problems
2) Downloaded the XML data definition for the Standard Purchase Order from XML Publisher Administrator
3) Created a blank word document and created the purchase order layout from scratch using the XML Publisher plug-in
4) Previewed it as a PDF in word - it looked fine (well, it was a start)
5) Exported the XSLFO
6) In XML Publisher created a new template and uploaded the XSLFO
7) Assigned the new template to the document in Purchasing
All good... the new template is defintately the one being used by the PO Output for Communication program. The problem of course is that it throws a useless error message :) - namely:
PoPrintingUtil.getBlobPDF(input,input) - After initializing the FOProcessor
PoPrintingUtil.getBlobPDF(input,input) - After setting the i/o stream and output format
PoPrintingUtil.getBlobPDF(input,input) - Error while generating the PDForacle.apps.xdo.XDOException
genDoc() : Exceptionjava.lang.Exception: Error while generating PDF :null
java.lang.Exception: Error while generating PDF :null
java.lang.Exception: Error while generating PDF :null
at oracle.apps.po.communicate.PoGenerateDocument.genDoc(PoGenerateDocument.java:2011)
at oracle.apps.po.communicate.PoGenerateDocumentCP.runProgram(PoGenerateDocumentCP.java:421)
at oracle.apps.fnd.cp.request.Run.main(Run.java:148)
When I run POXPOPDF in Debug I get:
getArchiveOn(): APPROVE
After calling genDocThu May 18 12:50:05 EST 2006
Adding the blob to vector
java.lang.NullPointerException
java.lang.NullPointerException
at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:89)
at oracle.apps.po.communicate.PoGenerateDocumentCP.runProgram(PoGenerateDocumentCP.java:304)
at oracle.apps.fnd.cp.request.Run.main(Run.java:148)
I know no one can magically fix this for me (I wish!) but does anyone have any suggestions on what to do next? I have no conditional formatting or any other more complex functionality, just a really boring PO layout with a logo.
Any suggestions welcome, in the meantime I will keep trawling through Metalink in search of a clue ;)
Thanks
JoHi Jo,
The first version for which the Template Builder was released is 5.0
Well, I guess I am one of the few who has a backported 4.5 version of the template builder. I did that for testing exactly your case. I just replaced our xdocore.jar file with the 4.5 version and it worked. The core.jar is not easily available. The files are part of the 4.5 patch, but I think it is too much work to get them out.
However, I would strongly recommend to upgrade to a later version of XML Publisher. We made huge improvements, since 4.5 - performance, translation, RTF template capabilities....
I just checked the process of converting an RTF template to FO and uploading it to EBS with 5.6.2 and it still worked. So it seems you can go straight to the latest version.
Hope that helps,
Klaus -
Problem with Special characters(Russian) using DynamicConfiguration
Hi,
I have a mail-RFC scenario where I am using adapter-specific message attributes and DynamicConfiguration to retrieve mail subject.It works fine.
We have a problem when the subject contains Russian special characters.In this case,whole mail subject gets converted into an irrelevant string.
Can anyone please suggest how to handle special characters in DynamicConfiguration using ASMA .
Thanks a lot for your help in advance.
Regards,
ShwetaYour UDF could be something like this:
String output = null;
String strs[] = input.split("\\?");
String charset = strs[1];
String encoding = null;
switch (strs[2].charAt(0)) {
case 'Q' :
encoding = "quoted-printable";
break;
case 'B' :
encoding = "base64";
break;
default :
break;
String subject = strs[3];
try {
InputStream is = new ByteArrayInputStream(subject.getBytes());
InputStream dis = MimeUtility.decode(is, encoding);
ByteArrayOutputStream out = new ByteArrayOutputStream();
byte[] b = new byte[4096];
for (int n;(n = dis.read(b)) != -1;) {
out.write(b, 0, n);
output = out.toString(charset);
} catch (Exception e) {
//implement catch...
return output;
where input is the input string.
For test purposes, use
String input = "=?KOI8-R?B?Rnc6IDEwMjEwMTMwLzA1MTEwNi/wMDE3NDkzLw==?=";
or
String input = "=?utf-8?Q?Auftragsbest=C3=A4tigung?=";
Regs,
Henrique. -
Handling Special characters in the data set
Hi All,
I am facing an issue in hadling special characters while writing data to a flat file.
The data fetched in toad query is *44CAÑADO* (with some specail character over N), but when this same data is written in textpad using UTL_FILE.put_line, the data written is converted to *44CAÑADO*.
Can anyone please help me how to handle these special charatcers so that the same data is written in text file as well.
Regards,
ShrutiTo find the database characterset, please see (Character Sets & Conversion - Frequently Asked Questions [ID 227330.1] -- 2. What is the database character set used for and how is it set?)
For your issue, please see these MOS docs.
UTL_FILE Adds ^U (Control U) NAK Character At the End of the Line. [ID 604150.1]
Character set conversion when using UTL_FILE [ID 227531.1]
NLS_LANG Explained (How does Client-Server Character Conversion Work?) [ID 158577.1] -- 5.8 UTL_FILE is writing / reading incorrect characters.
Thanks,
Hussein -
Handle special characters in the attribute name
Hi,
I am generating different view element in WD application dynamically. How to handle special characters other than '-/ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789' for the attribute name dynamically?
Thank you, in advance.
TruptiGoing with the obvious response - don't use them?
if you're using dynamic code, there is no reason (other than debug support) to give your created elements any meaningful name.
Just generate a GUID for each new element and use that.
If you need to be able to later search for and update the element a simple lookup table of GUID to reference string should work reasonably well.
Cheers,
Chris -
Finder crashes while generating PDFs in preview
Hi guys,
i've got a little problem.
Everytime i browse with the finder to PDFs it chrashes, while generating PDFs in preview.
Also it takes ages to generate the preview for a PDFs with about 1MB.
any hints and tipps about that problem ?
thanks in advance.
cheersHello sponger:
If no one posts a fix for you, I would consider an archive and install (NOT an erase and install):
http://docs.info.apple.com/article.html?artnum=107120
Be sure you have a good backup/retreat strategy before you proceed. In my case, I make bootable clones of my iMacs on an external firewire drive using a little program called SuperDuper (www.shirt-pocket.com).
Barry -
FTP ADAPTER: How to handle Special characters
Hi All,
We are running into issues with special characters while fpt'ing the file using FTP adapter.
ex: japanese characters '東邦チタニウム株式会社' would look as '???????????' in the transferred file.
The following steps are involved in the process.
1. Reads the data from a database.
2. Constructs an XML object.
3. Transforms the data into ftp msg.- In this step the spl. characters are fine
4. FTP's the msg.
5. The file on FTP server has issues.
Tried to change the file type to binary, UTF-8 etc.. but nothing worked.
Any help/pointers will be highly appreciated.
Thanks in advance.Hi Bhavishya,
Apparently your SAP database isn't configured to support Unicode. That would be the first solution to your problem, but I can imagine it's a bit drastic to convert your DB.
A second solution would be to encode the input description to ASCII before storing it in the database. When reading from the database, decode again to Unicode. This way, no information is lost. A suitable encoding would be Base64. e.g.
String description = "unday ebra";
String descriptionBase64 = new sun.misc.BASE64Encoder().encode(
description.getBytes("UTF-8")); // ""
// store descriptionBase64 in the DB
// later, when reading descriptionBase64 from the DB
String description2 = new String(
new sun.misc.BASE64Decoder().decodeBuffer(descriptionBase64), "UTF-8");
Instead of using Sun's implementation, a better alternative is to use the open source implementation
org.apache.commons.codec.binary.Base64 from Commons Codec .
The 3rd approach is indeed to normalize the description by replacing all special characters with their ASCII equivalent. A rather easy solution is as follows:
String description = "unday ebra";
String descriptionNormalized = sun.text.Normalizer.normalize(
description, sun.text.Normalizer.DECOMP, 0).replaceAll(
"[^p{ASCII}]", "");
sun.text.Normalizer decomposes the string, e.g. "éàî" becomes "e´a`i^", after which non-ASCII characters are being removed using a regular expression.Again, note that it's usually a bad idea to use sun.* packages, see note about sun.* packages. The above code only works with J2SE 1.4 and J2SE 5.0, but it breaks in J2SE 6.0 (where
java.text.Normalizer became part of the public API ;-). A good open source implementation can be found here: ICU4J (com.ibm.icu.text.Normalizer).
Kind regards,
/Sigiswald
Maybe you are looking for
-
Hi Experts, What is the table name for field ANZSO which is prasent in structure RF05L. REGARDS..........
-
Hi, I am a designer who is used to using the CD software Adobe Creative Suite or programs pre-installed from my employer. Is the CD version even available anymore? I was not finding it. I keep trying to download the trial version on the cloud. Pho
-
Why does xls files open with textedit
Here lately when I download files that are .xls the textedit program opens up? I can close and click on the download and it opens with microsoft excel. I download a lot of excel files and this happens all the time. Prior to 2 months ago when I downlo
-
BRF -fetch formula value set in the expression
Hi expert. My question is how to fetch formula value set in expression of BRF. Here is my scenario. For SC object BUS212 is have maintained the 2 levels approval process as below . object type u2013 BUS2121 Process schema - 3C_SC_700_002 100-appro
-
HT5100 Where are iTunes U shown in the itunes library
When I download iTunes U files, where abouts are they shown in the iTunes library?