Junk characters in java
Hi,
How to block the junk characters in java when csv file uploading.
Thanks
Not possible. You can only do it during processing the upload at the server side. If you also don´t know how to do that, then you need to be more specific about the problem before I could give an extended answer. For instance, you should elaborate "junk" here. At least, are you familiar with character encodings and the sense of it?
Similar Messages
-
Handling junk characters in XI
Hello,
I have developed a Inbound File-XI-SAP scenario .Where i have mapping failure in XI .I did my analysis and found that Business is sending us a file alogn with extra empty line as shown below
---> file should be limited to end of this line --> ";,99100;,99100;241;172;41;"9788761920041 ";
> this is extra line which i believe is new line character .This is causing my mapping to fail -->
So my question is how do we handle as i tried to write a batch program to handle this but in unix this BOX character as shown above is not there and file when read in unix is perfect.
Other way i tried is to open in different encoding but this is still showing up there .
So can we deal this using within XI ? If yes , plesae let me know .
Thanks for all help .You can have java mapping program to get rid of the junk characters:
You can refer the following sample code to achive it:
public class FixEncoding implements StreamTransformation {
public void execute(InputStream in, OutputStream out)
throws StreamTransformationException {
String instr;
instr = parseIStreamToString(in);
instr = instr.replace( '&', '&' );
out.write(instr.getBytes());
then in your interface mapping, put the jave mapping in front of normal mapping program.
Regards.
Liang
Edited by: Liang Ji on Mar 12, 2009 4:36 PM -
Unknown/Junk Characters in RFC call
Hey All,
I am having a strange issue in one of the RFC calls made from a Java System to our SAP system. We were getting random errors with this interface( the interface was working well before for a long time) . When I Captured the values sent during the RFC calls I found a lot of junk characters being sent by the other system. Is this the problem of the sending sytem or something in between?
Has anyone experienced anything like this before.
Any inputs on what could be the Issue.
ThanksAsh,
The Java Application is connected to the SAP System using Java Connector.
aRs,
The rfc is basically a wraper of standard Bapi "BAPI_REPMANCONF1_CREATE_MTS" for confirmations which has a IMSEG related structure with a lot of QUAN fields. What do you think is the issue with RFC calls and QUAN fields. Becausing changing all the QUAN's to Chars and converting it back to QUAN in the wrapper will be a decently big change.
I was kindoff ruling out the unicode issue because this interface was working fine for more the 6 months, and we were unicode long time ago.
One thing I suspect where the Issue could be is the SDK kit for the Java application. We recently Updated our Kernel Version and I think we should Upgrade the SDK';s too which was not done. What do you think??
Thanks -
Junk Characters in Devanagari Character Display
Dear All:
I am working on a JAVA Devanagari Word Processor in which user types in English and adjacent JTextBox converts it into Devanagari(Hindi) Fonts.
This is how I have specified the fonts:
Font f2 = new Font("Other", Font.PLAIN, 18);
textbox2.setFont(f2);
But my problem is that I see a lot of junk characters which shouldnt be there.
They do go away if I minimize the Window and then mazimize it.
But theyare quite an eye-soar.
Any suggestions, pls.
Thanks.
ChetanDear All:
I am working on a JAVA Devanagari Word Processor in
which user types in English and adjacent JTextBox
converts it into Devanagari(Hindi) Fonts.
This is how I have specified the fonts:
Font f2 = new Font("Other", Font.PLAIN, 18);
textbox2.setFont(f2);
But my problem is that I see a lot of junk characters
which shouldnt be there.
They do go away if I minimize the Window and then
mazimize it.
But theyare quite an eye-soar.
Any suggestions, pls.
Thanks.
ChetanJust sounds like you're drawing things inconsistently. When you minimize/maximize the window, your paint() or paintComponent() or equivalent method(s) are being called, which then re-paint it correctly. Sounds like somewhere else in your code you are painting other junk intermittently and inconsistent with the way paint() will do it. -
Junk characters display while using multipart with html content in Javamail
Hi All,
I have used Java mail API to send mail with attachment. To enable to attachment in mail and to do content formatting i have used multipart and html content type together.
My web application runs on apache tomcat 5.5 in MAC server. Java version is 1.5.
The Function which i have used for sending mail with attachment is as follows:
public void sendmailAttached(String to,String from,String host,boolean debug,String mailContent,String mailSubject,String cc,String attachFiles)
String mailarray[]=to.split(";");
Properties props = new Properties();
//props.put("mail.smtp.port","425");
props.setProperty("mail.smtp.host", host);
if (debug) props.setProperty("mail.debug", ""+debug);
Session session = Session.getInstance(props, null);
session.setDebug(debug);
try {
Message msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(from));
javax.mail.internet.InternetAddress[] toAddress=new javax.mail.internet.InternetAddress[mailarray.length];
for (int i=0;i<mailarray.length ;i++ )
toAddress=new javax.mail.internet.InternetAddress(mailarray[i]);
msg.setRecipients(Message.RecipientType.TO, toAddress);
msg.setSubject(mailSubject);
try{
String ccaray =cc;
String mailarray1[]=ccaray.split(";");
javax.mail.internet.InternetAddress[] CCAddress=new javax.mail.internet.InternetAddress[mailarray1.length];
for (int i=0;i<mailarray1.length ;i++ )
CCAddress[i]=new javax.mail.internet.InternetAddress(mailarray1[i]);
msg.setRecipients(Message.RecipientType.CC,CCAddress);
}catch(Exception ss)
System.out.println("CC mail exception is ====>"+ ss.getMessage());
msg.setSentDate(new java.util.Date());
Multipart multipart = new MimeMultipart("related");
BodyPart messageBodyPart = new MimeBodyPart();
messageBodyPart.setContent(mailContent, "text/html");
multipart.addBodyPart(messageBodyPart);
String fileName = attachFiles.substring(attachFiles.lastIndexOf("/")+1,attachFiles.length());
if(!fileName.equals(""))
messageBodyPart = new MimeBodyPart();
DataSource source = new FileDataSource(attachFiles);
messageBodyPart.setDataHandler(new DataHandler(source));
messageBodyPart.setFileName(fileName);
multipart.addBodyPart(messageBodyPart);
msg.setContent(multipart);
Transport.send( msg );
catch(MessagingException mex)
Exception ex = mex;
if (ex instanceof SendFailedException)
SendFailedException sfex = (SendFailedException)ex;
Address[] invalid = sfex.getInvalidAddresses();
if (invalid != null) {
if (invalid != null) {
for (int i = 0; i < invalid.length; i++)
System.out.println("Invalid Addresss --------> " + invalid[i]);
try
Message msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(from));
Multipart multipart = new MimeMultipart("related");
BodyPart messageBodyPart = new MimeBodyPart();
messageBodyPart.setContent(mailContent, "text/html");
multipart.addBodyPart(messageBodyPart);
Address[] validUnsent = sfex.getValidUnsentAddresses();
javax.mail.internet.InternetAddress[] toAddress=new javax.mail.internet.InternetAddress[validUnsent.length];
if (validUnsent != null) {
for (int i = 0; i < validUnsent.length; i++)
System.out.println("Valid Address ------>"+validUnsent[i]);
String test = validUnsent[i]+"";
toAddress[i]=new javax.mail.internet.InternetAddress(test);
msg.setRecipients(Message.RecipientType.TO, toAddress);
msg.setSubject(mailSubject);
String fileName = attachFiles.substring(attachFiles.lastIndexOf("/")+1,attachFiles.length());
if(!fileName.equals(""))
messageBodyPart = new MimeBodyPart();
DataSource source = new FileDataSource(attachFiles);
messageBodyPart.setDataHandler(new DataHandler(source));
messageBodyPart.setFileName(fileName);
multipart.addBodyPart(messageBodyPart);
msg.setContent(multipart);
Transport.send( msg );
catch(Exception e)
System.out.println("Mail Not Send");
else
System.out.println("Mail Server Not Connectd ");
This code is working properly and i am able to send mail with attachment and html formatted content without any problem. But console of server is filled up with too much junk characters because of which the catalina.out file of tomcat server is becoming fully filled.
Sample cosnole display with junk characters are as follows:
Subject: HBSP - DRUCKER - QC - CH16 - QC R2 Completed
MIME-Version: 1.0
Content-Type: multipart/related;
boundary="----=_Part_34_15681668.1247471518887"
------=_Part_34_15681668.1247471518887
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<b>Hi,</b><br><br> Chapter CH16 in the project DRUCKER is Completed . <br><br> <b>Comments :</b> Qc Accepted.<br><br> <b><i>Thanks,<br>ANTONY.</i></b>
------=_Part_34_15681668.1247471518887
Content-Type: application/octet-stream; name=9420317_CH06_p084-119.pdf.zip
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=9420317_CH06_p084-119.pdf.zip
UEsDBBQAAAAIAMOz6TqHaQ4BUtXhAGzP8QAZAAAAOTQyMDMxN19DSDA2X3AwODQtMTE5LnBkZsQ7
CTxUX9tCUpIWEomxpoWZuTN3FmvW7P9skaUajCXGiCHSYiuKFrIvlWStROSvaBEtiIpkK5WlUipa
ZKl898wYRP/37fve7/e69TjnPuc5z3LOuc95zjP3ym7S1lXAKuL5ZTu7HjTyL8ATiCgMiu6wA6Wi
gjZy86RSvN12U51QWLQRCguT8ESISED/hcITMWgdFJZIgPAwBm2CwhHQFqAdRySRcWg9lC2KBBNQ
WAIRZ6+mxk/1dEI48qNYF7+/N9WZHwiCSPyY8QtLQDFLlCf/AhYGgiHyDBwBIs7EETEzcCR4Bg6H
IZBn4LBE7AwcNBOHJ87EwWQ8aTqOgIWJM3C4mX2JMH6GLiQiHjMDR8bD03BYDBYizcDh8LjpOCyM
xczAETH4mbgZOmNhmDCDHwE7Qz+IhMNO54eHCKTp/GAcboYuBBJMmi6DSIZxU+lYF7KSJnEMb4qb
B9WbH1md5sjCROHJMHqTN9VvfPGRcGgzOp2BwhOQMUKZofU9nenIDYF1o22rgtXU1EWGRgsia2vp
Like this display of junk characters are filling up multiple pages of console file.
Can any one suggest me how to overcome this problem?
Many thanks in advance.There is no "sendmail" method in the JavaMail API.
The debug flag is set using the Session.setDebug method, or by setting the Session property "mail.debug".
If you're using someone else's helper classes with JavaMail, they may provide another way to set it. -
WriteUTF() append junk characters to Bluetooth printer
Hi guys,
I am having problem sending printing to a portable bluetooth printer.
It always print out additional junk characters in front of the content.
Example:
KHello World
**It should be display "Hello World" only. A random characters will be display in front of the content, for
this case is the letter "K". I google and search many forums but found nothing that can help me solve this
problem. I know WriteUTF() will add 2 bytes in front to my string. FYI. I previously use WriteChars() to print
english words but now need to use WriteUTF to print the Chinese words. Is there anyway to fix this? Any help
will be appreciated.
My Coding:
============
String url = "btspp://00099BC9BC98:1;authenticate=false;encrypt=false;master=false";
StreamConnection con = (StreamConnection) Connector.open( url );
DataOutputStream out = con.openDataOutputStream();
retStr = "Hello World"; //This is a message with english and chinese characters
out.writeUTF(retStr);
out.write(0x0A); //print & line feed
Thread.sleep(500);
out.flush();
out.close();
con.close();*Don't post general Java questions here*
-
Report Pdf output getting Junk characters for some boiler Plate fields
Hi All
For Dunning Letter Report registered in Oracle Applications,made changes in Column headings like added customer number as Kunde for German Letter
but in pdf output it's appearing as junk characters even date field is happening like that. It's happening for German, Spanish, Italy and French Letters. Working ok for Netherlands, English.
any input to fix this solution will be great
Thanks
Kamalakar.GMaybe you check the NLS_LANGUAGE-settings on the client where you "edit" the reports-definition.
-
Oracle Report ouput is coming in english and junk characters
Hi ,
I am facing an issue with oracle report output in R12.
The Report out is coming in english and junk characters.
this report is custom report.
Migrated from 11i to r12 instance.it is working fine in 11i with output as PDF.
Sample out put is attached.Pl see if MOS Doc 1321874.1 is relevant
-
How to Handle Junk Characters in BI Publisher Report?
Hi Team,
I have Created a column in obiee analytics report which has logic as '1/0'. After creating this column I am not getting result for this column(blank).
When Extracted the report into XML file,I am not able to see value for that column as well. This is what I need too.
But issue is, For my layout(below is sample example of my layout) It is not displaying the value as is in Analytics report in BIP Report. In Anlytics report I am getting Blank.In BIP it is giving the Junk Characters. Ex: SG&A row.
I need to replace this Junk characters with space.This is my requirement.
(p) Fuel
0
0
0
0
0
0
0
0
0
(q) Other Variable
1,543
1,325
218
4,123
3,976
147
4,123
3,976
147
Total Cost Of Goods Sold (Excl. S/L)
28,944
30,239
-1,295
87,252
89,408
-2,156
87,252
89,408
-2,156
(r) Straightline Expense
1,679
1,976
-297
4,501
5,929
-1,428
4,501
5,929
-1,428
Total Cost Of Goods Sold
30,622
32,215
-1,593
91,753
95,337
-3,584
91,753
95,337
-3,584
Gross Profit (Excl. S/L)
-133,526
-130,796
-2,730
-397,999
-392,800
-5,991
-397,999
-392,800
-5,199
SG&A
�
�
�
�
�
�
�
�
�
(s) Payroll & Related
4,515
6,158
-1,643
14,910
18,521
-3,611
14,910
18,521
-3,611
here is the XML code for SG&A record:
- <G_1>
<COLUMN0>MAR-2013</COLUMN0>
<COLUMN12>SG&A</COLUMN12>
</G_1>
Can you please help me in achieving this.
Thank You in Advance,
KK.Hi,
there's no direct support for the format triggers out of Oracle Reports. Therefore they are mentioned in the log file and in the created layout after conversion the objects with format triggers are colored red to show, that there you had to do some additional work.
Currently you had to built the logic of format triggers in BI Publisher new. Hve a look in the User Guide, there are some examples for if or choose statements.
regards
Rainer -
Junk characters like" � � "displayed in the jsp page please help.
Hi,
I am getting junk characters like � � displayed in the jsp page.
In the JSP page i used javascript "& nbsp" for appending spaces to a string "CCR" to get "CCR " .
Now the Resultant string "CCR " has three spaces appended to its right.
This String is set in session in that JSP page.
In the next JSP page i am getting that string from session.
After getting the string the "substring" function is performed to get only the first 5 charcters of the string. Now the result is displayed as " CCR� � " with has last 2 characters as junk values � � insteed of displaying as "CCR ". Please help me in solving this issue.
Please note that initially the sting "CCR" is got from the Oracle database in Solaris Machine.
Regards,
Vijayhave you tried:
strenuously inspecting the string that is coming from the db? do an actual loop over the string, character by character, dumping to System.out to make sure the characters are EXACT coming out of the db.
note you have to append " " not just "& nbsp"
post the code that is doing the output. the relevant bean code, the jsp, everything relevant - WITH COMMENTS discussing where things are happening.
Also, is it "weird characters" in the browser only? have you done a view source on the actual html source that the browser is rendering (right click in IE and click view source). browsers can act odd if you don't feed then exactly what they want, and it looks like you're feeding it escaped characters that it is rendering as something else. -
Junk characters in data transfer Program
Hello ABAP gurus,
i am facing the problem in an custmom made ABAP Interface program. the program has an option of downloading the files in local system(Windows system) and in Unix system (AL11). when i dwnload the files locally and feed that file to a CRM system, the CRM processes the file correctly but in case if we schedule a job then the CRM reads the file from Unix system and generates an error showing the junk characters for the special european characters. please request you guys to help me in this regard.Hi,
When you download the file locally are able to see the junk character in the file.
Logon on to the unix system and check the file content there and if any junk characters are there, usually when we upload the file then you will have those junk character being populated at the end of the record, open the file in unix and then remove those characters and reprocess that again, it will get through.
Thanks,
Mahesh. -
Printer has been setup in one server but it's printing Junk characters
Printer has been setup in one server but it's printing Junk characters
Pdf file's sent from server and from local machine are printing fine..But prints sent from Oracle Reports are not getting printed, instead it is printing some garbage contents.Forgot to mention it's 10gAS (10.1.2.3) forms & reports
-
Preview Template shows junk characters
Hi,
I have uploaded my RTF in the Template Definition and clicked on Preview Template to view it.
I see some junk characters coming in the PDF Preview output for the Euro symbol..If i run this as a concurrent program or run it locally in the system or preview it in format other than PDF everything else works fine..
This issue is only when we preview the template from the Template Definitions, am having the issue of junk characters for Euro symbol.
Any suggestions/helps pls?
Regards,
Genoo
Edited by: Geno on Jan 17, 2012 11:19 AMAny help or suggestions please?
Regards,
Genoo -
Report Output in text giving junk characters
Hi All
I have created custom report in rdf file format. When running the report set output as PDF means its come good. Incase i will change report output as text means its shows lot of junk characters in output time .
How can i will solve the issue
Sample Text Output :
(s7BTAN CHONG MOTOR ASSEMBLIES S(s0B
<-(s7BNo: 249, Jalan Segambut, 51200 Kuala <-(s0B
<-(s7BSTATEMENT OF ACC(s0B
<-(s7BAS ON(s0B (s7B16-APR-13<-(s0B
<-(s7BSupplier (s0BAFM MART SDN BHD <-(s7BSupplier Account N<-(s0B
NO 6 JALAN SS 4C/5
TAMAN RASA SAYANG
TAMAN RASA SAYANG
PETALING JAYA
PETALING JAYA
SELANGOR
Malaysia-47301
03-78048099 Document Cur Base Curr
Docume Curre --------- ---------------
nt Ref Num Doc T Tranx Due D !CurRa Deb Cred Deb Cred Balan
(s7BOpen I(s0B
*****TESTINGABC STD INV ***********MYR 456 456 456
*****TESTING123 STD INV ***********MYR 1000 1000 1000
(s7BTotal Pa<-(s0B (s7B0(s0B (s7B1456(s0B (s7B1456(s0B
(s7BTotal Outstandin(s0B (s7BCurrent(s0B (s7B31 - 60 Days(s0B (s7B61 - 90 Days(s0B (s7BAbove 90 D(s0B
(s7B1456(s0B (s7B0(s0B (s7B0(s0B (s7B0(s0B (s7B0(s0B
Edited by: 993525 on Apr 16, 2013 10:25 AMHi
What is your database/application characterset? - AL32UTF8
NLS_LANG : AMERICAN_AMERICA.WE8ISO8859P1
concurrent request log file
-------------------+
XXTC Custom: Version : UNKNOWN
Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
XXTCM_SUPPLIER_SOA module: XXTC Supplier Statement
Current system time is 16-APR-2013 10:40:18
+-----------------------------
| Starting concurrent program execution...
+-----------------------------
Arguments
P_VENDOR_NUM_FROM='2'
P_VENDOR_NUM_TO='2'
P_INVOICE_DATE_TO='2013/04/16 00:00:00'
APPLLCSP Environment Variable set to :
Current NLS_LANG and NLS_NUMERIC_CHARACTERS Environment Variables are :
AMERICAN_MALAYSIA.AL32UTF8
Enter Password:
Report Builder: Release 10.1.2.3.0 - Production on Tue Apr 16 10:40:19 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Start of log messages from FND_FILE
End of log messages from FND_FILE
Executing request completion options...
Output file size:
446
------------- 1) PRINT -------------
Printing output file.
Request ID : 607096
Number of copies : 0
Printer : noprint
Finished executing request completion options.
Concurrent request completed successfully
Current system time is 16-APR-2013 10:40:20
Thanks Sanjay
Edited by: 993525 on Apr 16, 2013 11:38 AM -
Report displaying junk characters or Greek or some other language
Hi All,
I have one Custom report in PDF. It is a simple tabular report. When I run this report from Report Builder, it runs fine but when I register it in Oracle Apps and run it from there, it displays all the characters in Greek or some other language or junk characters. Sometimes it works if I change font. But its a trial and error. I dont understand why is it happening. This has happened with one of my other reports too. It worked when I changed the font and its size. This time it didnt work. Any clue how can I fix this issue?
Any lead will be appreciated.
Thanks,
CAH
Edited by: user638181 on Sep 3, 2009 7:05 AMHi Hussein,
We have similiar issue with our custom PDF reports. We are in the process of upgrading from 11.5.9 to R12.
All these reports work fine in 11.5.9.
Following are the details of our R12 environment:
1) What is the application release? Application release is 12.1.1
2) What is application/database characterset? Database - 11.1.0.7.0 and characterset is UTF8.
3) Is this a text or bitmap report? What is the report language? - It is a text report and Language is English
4) Do you use PASTA for printing? - Yes we do
5) Do you get the correct printout if you print the concurrent request output file from the OS? - If I run the report from report builder directly, Yes. If from Oracle Apps, no.
6) Expected output: "Days in Queue"
Actual Output: when I copy and paste the output here it is showing correct. But on the report it is showing
something like ∆Ωµ.....
7) If I try changing the font, it works
8) A different text field on the same report with the same font shows good.
I would appreciate your help on this one.
Thanks
Vishnu
Maybe you are looking for
-
Hello everyone, I have a late 2007 15" MacBook Pro (not Unibody model) that has been recently upgraded to Mac OS X Lion (not Mountain Lion). Ever since the upgrade, when I power it on, everything loads as it should but what I notice is that my MacBoo
-
I am using an XY graph with 5 curves which belong to one of two y axes each. All curves share the same array of x values. I do not like the cursor legend so I want to read out the values of the one cursor programmatically. I can create a multi-plot c
-
Donde consigo pages para macbook pro 10.6.8
Hola, intento comprar Page y no puedo porque la versión de la tienda es superior a mi macbook pro 10.6.8. Cómo accedo a la versión para mi portátil?
-
I downloaded the itunes and when i try to click on the icon, it wont go to the itunes
i downloaded the itunes and when i try to click on the icon, it wont go to the itunes..
-
Multiple EDI Connections from ECC
Hello All, Could you please let me know is it possible to create 2 ALE connections in 1 system and then choose as per partner profile which connection to be assigned? Regards, Anand