Character output problems.
I'm currently writing a java console program that deals with european currency.
The problem comes when I try something along the lines of the following (the printing of the currency symbol being the important part):
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.Locale;
public class UnicodeTest {
public static void main(String[] args) {
Locale eu1 = new Locale("en", "GB", "WIN");
DecimalFormatSymbols symbols = new DecimalFormatSymbols(eu1);
DecimalFormat eu = new DecimalFormat(symbols.getCurrencySymbol() + "0.00", symbols);
double number = 3f;
System.out.println(number + " = " + eu.format(number));
}The problem is that this should output 3 = ?3.00. It does on Unix systems but not on Windows,Windows end's up outputting an accented u (? (if this shows up on the forum) instead of the ? sign.
It works in Windows when outputting to a window (i.e. TextArea, etc.) but not to the system console.
Can anyone shed some light on this?
Oh dear, those first and last question marks we're supposed to show up as pound signs (uk currency symbol).
Similar Messages
-
Character Converting Problem at File Adapter
I am having a character conversion problem bringing in a XML file into XI.
It is converting the data wrong.
I have a file adapter picking up Audit.xml encoding is utf-8, use binary mode to pick it up.
XI takes the file and converts it into a text file.
I compared the hex of Audit.xml source file and the Audit.txt file and the characters are different for a specific few.
See attached image for details
Please let me know if any additional information will help
http://i9.photobucket.com/albums/a68/tkc204/SAP%20XI/Audit.pngActually for this case Christian is right the source xml that I am receiving wasn't valid UTF-8. The program generating the xml was just putting the encoding - utf-8 tag on top because that's what the code told it to do.
The actual data is Windows-1252 in xml. So when XI reads it, it uses the utf-8 tag on top and is expecting UTF-8, but it was getting something else causing the unsupported characters to get converted.
The HEX was different on the Source XML comparing it to what XI was generating after File Adapter.
After making the output change to Windows 1252. It changes back to the expect HEX.
Source - is at Windows 1252
XI - it will use UTF-8 (no way to change it)
Target - forced to create in Windows 1252
Other helpful tools I used: W3C Validator - upload the file and found that I wasn't receiving UTF-8
I hope this is clear and helps someone else in the future.
Thanks For everyone's input.
Chirag -
Macbook mini DVI to DVI output problems
hi
I've been using a samsung syncmaster 22" with my macbook for about a year now with no problems using the mini DVI to DVI connection
then earlier this week i used a different DVI cable to plug my playstation 3 into the screen, when i plugged the computer DVI cable back into the screen lots of red/pink pixels have taken over the screen and when the desk is nudged red lines flash up
i thought it might be either the DVI cable or the mini DVI to DVI adapter and replaced both to no avail, i have also tested all the cables on other screens/with other computers, and tested the screen with my playstation. Screen and cables all work fine so i think it must be some kind of output problem, but cant work out what it could be seeing as nothing would have happened to the port on the actual computer whilst changing connections on the samsung screen
sorry for the long winded post, really wanna know what the problem is hereHi cbeth,
welcome to macbook forum.
For your friend macbook, try to press F7 back and forth to switch between mirror and expanded mode.
Try to update your macbook hardware firmware and software using software updater and repair permission after that...application/utilities/disk utility/repair permission.
Also reset your PRAM and PMU.
Open your friend system preference / display and try to compare and set yours similar to hers, including resolution, color depth, refresh rate.
Good Luck. -
Character conversion problems when calling FM via RFC from Unicode ECC 6.0?
Hi all,
I faced a Cyrillic character convertion problem while calling an RFC function from R/3 ECC 6.0 (initialized as Unicode system - c.p. 4103). My target system is R/3 4.6C with default c.p. 1500.
The parameter I used in my FM interface in target system is of type CHAR10 (single-byte, obviously).
I have defined rfc-connection (SM59) as an ABAP connection and further client/logon language/user/password are supplied.
The problem I faced is, that Cyrillic symbols are transferred as '#' in the target system ('#' is set as default symbol in RFC-destination definition in case character convertion error is met).
Checking convertions between c.p. 4103 and target c.p. 1500 in my source system using tools of transaction i18n shows no errors - means conversion passed O.K. It seems default character conversion executed by source system whithin the scope of RFC-destination definition is doing something wrong.
Further, I played with MDMP & Unicode settings whithin the RFC-destination definition with no successful result - perhaps due to lack of documentation for how to set and manage these parameters.
The question is: have someone any experience with any conversion between Unicode and non-Unicide systems via RFC-call (non-English target obligatory !!!), or can anyone share valuable information regarding this issue - what should be managed in the RFC-destination in order to get character conversion working? Is it acceptable to use any character parameter in the target function module interface at all?
Many thanks in advance.
Regards,
Ivaylo Mutafchiev
Senior SAP ABAP Consultanthey,
I had a similar experience. I was interfacing between 4.6 (RFC), PI and ECC 6.0 (ABAP Proxy). When data was passed from ECC to 4.6, RFC received them incorrectly. So i had to send trimmed strings from ECC and receive them as strings in RFC (esp for CURR and QUAN fields). Also the receiver communication channel in PI (between PI and RFC) had to be set as Non unicode. This helped a bit. But still I am getting 2 issues, truncation of values and some additional digits !! But the above changes resolved unwanted characters problem like "<" and "#". You can find a related post in my id. Hope this info helps.. -
ECC6.0 - PDF issue - Junk Character output after Upgrade from 4.7c
Hi All,
I am working in Uprgade project(from 4.7c Non-unicode system to ECC6.0 unicode system).
We are facing PDF output issue in ECC6.0 that means we are getting junk character output(screenshot is attached for your reference).
In 4.7c , we have stroed the OTF data in table after generated from smartform as we should not get different output in future. Whenever we need output of the same then we are getting the OTF data from that table and we will generate pdf through "Convert_otf" function module.This logic is working fine in 4.7c.
In ECC6.0 ,the same logic is not working as system is unicode sytem and we are getting junk character output.
As per my old upgrade project experience , i have used the below piece of code for solve this junk character issue but still I am facing the same issue.
Kindly note that in my old upgrade project i have regenerated the OTF data in ECC6.0 and used the below piece of code then I got correct output but here I have to use the old OTF data (from table) which was generated in 4.7c.
Please any one can give solution for this issue.
Regards
Anandakumar.K
+91 9486963561.
REPORT z_display_notification_tst.
Local Vairable Declaration
TYPES: lt_pdf_table(1000) TYPE x.
Local Vairable Declaration
DATA :
lv_otf_data TYPE STRING, " OTD data in string format
lv_length TYPE i, " OTF Length
lv_lines TYPE i, " No of lines
lv_no_of_recs TYPE int4, " No of OTF Lines
lv_offset TYPE int4, " Offset
pdf_fsize TYPE i,
lv_binfile TYPE xstring,
gv_reportsize TYPE i,
l_url(80) TYPE c,
l_pdf_data TYPE STANDARD TABLE OF lt_pdf_table ,
l_pdf_line TYPE lt_pdf_table,
l_offset TYPE i,
l_len TYPE i,
lt_pdf_table TYPE rcl_bag_tline,
lt_otfdata TYPE tsfotf,
ls_otfdata TYPE itcoo. " Line type of OTF data
DATA:
g_html_container TYPE REF TO cl_gui_custom_container,
g_html_control TYPE REF TO cl_gui_html_viewer.
******************GET OTF data from Table ******************************
Primary Keys used for selection : BUSKEY,
NTFTYP,
TRNTYP,
SELECT SINGLE otf_data FROM znotif_otf
INTO lv_otf_data
WHERE buskey EQ 'LS_000000000010001470'
AND ntftyp EQ '0037'
AND trntyp EQ 'ACT'.
Get the length of the OTF data stored as stream of string************
l_len = STRLEN( lv_otf_data ).
Compute the OTF lines
lv_lines = l_len / 72.
lv_no_of_recs = lv_lines + 1.
Set the offset to initial
lv_offset = 0.
*Reconstruct the OTF data from the string
DO lv_no_of_recs TIMES.
IF sy-index NE lv_no_of_recs .
Get OFT format: command ID
ls_otfdata-tdprintcom = lv_otf_data+lv_offset(2).
lv_offset = lv_offset + 2.
Get OTF format: command parameters
ls_otfdata-tdprintpar = lv_otf_data+lv_offset(70).
lv_offset = lv_offset + 70.
ELSE.
Last line contains only the OFT format: command ID "//" (End of file)
ls_otfdata-tdprintcom = lv_otf_data+lv_offset(2).
lv_offset = lv_offset + 2.
ENDIF.
Append the OTF data to Export OTF table
APPEND ls_otfdata TO lt_otfdata.
CLEAR ls_otfdata.
ENDDO.
*************************Convert OTF to PDF**************************
IF lt_otfdata IS NOT INITIAL.
clear: lv_binfile,
pdf_fsize.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
IMPORTING
bin_filesize = pdf_fsize
bin_file = lv_binfile
TABLES
OTF = lt_otfdata
lines = lt_pdf_table
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
Call screen***********************************
Call screen
CALL SCREEN 100.
RETURN.
*& Module STATUS_0100 OUTPUT
text
MODULE status_0100 OUTPUT.
SET PF-STATUS '100'.
SET TITLEBAR '100'.
Convert bin file
clear :l_len,
l_offset.
free l_pdf_data[].
l_len = XSTRLEN( lv_binfile ).
WHILE l_len >= 1000.
l_pdf_line = lv_binfile+l_offset(1000).
APPEND l_pdf_line TO l_pdf_data.
ADD 1000 TO l_offset.
SUBTRACT 1000 FROM l_len.
ENDWHILE.
IF l_len > 0.
l_pdf_line = lv_binfile+l_offset(l_len).
APPEND l_pdf_line TO l_pdf_data.
ENDIF.
Initialise and create the HTML container
IF NOT g_html_container IS INITIAL.
CALL METHOD g_html_container->free
EXCEPTIONS
OTHERS = 0.
CLEAR g_html_container.
ENDIF.
CREATE OBJECT g_html_container
EXPORTING
container_name = 'HTML_CONTAINER'.
Initialise and create the HTML control that will display the
PDF output as URL
IF NOT g_html_control IS INITIAL.
CALL METHOD g_html_control->free
EXCEPTIONS
OTHERS = 0.
CLEAR g_html_control.
ENDIF.
CREATE OBJECT g_html_control
EXPORTING
parent = g_html_container
saphtmlp = 'X'.
Load the pdf data and obtain the URL
CALL METHOD g_html_control->load_data
EXPORTING
size = pdf_fsize
type = 'application'
subtype = 'pdf'
IMPORTING
assigned_url = l_url
CHANGING
data_table = l_pdf_data
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
raise cntl_error.
ENDIF.
CALL METHOD cl_gui_cfw=>flush.
Show the URL
CALL METHOD g_html_control->show_url
EXPORTING
url = l_url.
ENDMODULE. " STATUS_0100 OUTPUT
Edited by: Anandakumar.K on Oct 25, 2011 12:47 PM
Edited by: Anandakumar.K on Oct 25, 2011 12:54 PMHi,
as you can see in SAP notes 842767 and 1349413, spool data cannot be converted properly for all types in a Unicode conversion.
This might be possible if you have English (US7ASCII) characters only, but with Chinese characters I do not think that a small piece of code can do it ...
Hence I think you need to recreate the data on the Unicode system ...
Best regards,
Nils Buerckel
Edited by: Nils Buerckel on Nov 3, 2011 1:51 PM -
Backup failure due to Character set problem
Hi,
I am manually running a COLD backup script in Windows NT environment and all the logs has been captured below:
Recovery Manager: Release 8.1.6.0.0 - Production
RMAN-06005: connected to target database: db1 (DBID=754030292)
RMAN-06009: using target database controlfile instead of recovery catalog
RMAN> shutdown immediate;
2> startup mount;
3> RUN {
4> ALLOCATE CHANNEL disk1 TYPE disk;
5> BACKUP DATABASE TAG 'db1_db_full' FORMAT 'e:\backup\db1\db1_backup';
6> copy current controlfile to 'e:\backup\db1\Control_db1.ctl';
7> }
8>
RMAN-06405: database closed
RMAN-06404: database dismounted
RMAN-06402: Oracle instance shut down
RMAN-06193: connected to target database (not started)
RMAN-06196: Oracle instance started
RMAN-06199: database mounted
Total System Global Area 934143244 bytes
Fixed Size 70924 bytes
Variable Size 260554752 bytes
Database Buffers 673439744 bytes
Redo Buffers 77824 bytes
RMAN-03022: compiling command: allocate
RMAN-03023: executing command: allocate
RMAN-08030: allocated channel: disk1
RMAN-08500: channel disk1: sid=13 devtype=DISK
RMAN-03022: compiling command: backup
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure during compilation of command
RMAN-03013: command type: backup
RMAN-06003: ORACLE error from target database: ORA-06550: line 1, column 166:
PLS-00553: character set name is not recognized
ORA-06550: line 0, column 0:
PL/SQL: Compilation unit analysis terminated
RMAN-06031: could not translate database keyword
Recovery Manager complete.
As the above log shown, I cannot do any backup command in the RUN bracket and it complains that the character set is not recognized.
This set of error happens when I have create six other Oracle databases in my NT box. Before that, I can manually run the backup with no problem and a backupset has been generated.
If you have come across this problem and have solutions of it. That will be great.
Thanks !!
nullkk001 wrote:
Hi ,
The export Backup failing due to character set problem
. . exporting table ravidlx
EXP-00008: ORACLE error 6552 encountered
ORA-06552: PL/SQL: Compilation unit analysis terminated
ORA-06553: PLS-553: character set name is not recognized
P
Please suggest how to set character set
I don't know what you have.
I don't know what you do.
I don't know what you see.
It is really, Really, REALLY difficult to fix a problem that can not be seen.
use COPY & PASTE so we can see what you do & how Oracle responds.
do as below so we can know complete Oracle version & OS name.
Post via COPY & PASTE complete results of
SELECT * from v$version; -
Using translate function to correct character set problem....
I have a table(TBL_STOCK) on Oracle XE.
Rows come from sql server 2005 with a trigger on sql server table via the linked server.
But there is a character set problem with some character like İ,Ş,Ğ.
They change to Ý,Þ,Ð. in Oracle.
How can i correct these ? Do you suggest the TRANSLATE function ?
What do u think, if i create an After Insert trigger on Oracle table(TBL_STOCK) and convert these character using the Translate function when they inserted from sql server.
Anyone have any other ideas that can be more efficient. Any thoughts appreciated.
Thanks in advance.
Adam
PS:The NLS_CHARACTERSET of Oracle is AL32UTF8.It is sql server 2005 and Collation is SQL_Latin1_General_CP1_CI_AS
-
Mac mini audio output problems
This is similar to a problem that appeared before, but with a different twist.
On 4 July all was well. On 5 July I switched on and there was no "chord" from the Mac. When I collected my mail - no sound from my speakers (which are part of my screen). Logged on to a couple of sites - no sound.
The System Profiler, under the "Audio (Built In)" category, says: "No Built-in Audio." I know that's wrong because it's always worked before and when I plug my headset in it works fine.
When I go to the Sound preferences panel in System Preferences, it finds the headset but if I unplug that it finds nothing.
I tried running the hardware test (by putting in the OS X install disc and holding D during startup.) It couldn't find a problem.
So, as far as I can see, audio output is fine for the USB headset output but not for the others. Is there a simple fix? The nearest Apple store is about 200 miles away and I don't fancy the idea of posting the Mac off.
(And I think it's still under warranty for a couple more weeks.)
Mac mini Mac OS X (10.4.10)hello mini users with the "no audio output" problem
it seems that there are faulty output jacks in the macbook and the mac mini
there are two things you can try:
i tried everything and began thinking about what new software i had installed. it was "macam" which enables you to use older webcams on OSX. i needed that to use my webcam on skype.
macam installs a file called "macam.component"
if you have the same, do this - take that file out of:
(your hard drive)/library/quicktime - macam.component
and just put it on your desktop
restart, then in your sound pref's choose your audio output (if doesn't work restart again)
the first time i took it out, i had my sound back instantly, another time i had to choose audio output in sound prefs. you kind of have to try different things. after you get your sound back, you can put back "macam.component" to use your webcam.
it seems macam causes the problem, the two can not work at the same time.
the second thing: if you dont have "maccam" try plugging and unplugging output jack a few times and restarting until you have sound.
the problem still could be with the OSX 10.4.10 update / quicktime...or maybe even a hardware problem like others with macbooks were saying (with the red light), not sure.
people with macbooks and who have the red light on, say to use a paperclip to turn off the switch inside.
my mini does not have a red light on. i tried using a paperclip but it doesnt work.
hope this helps, beleive me i feel your pain!!!!
what good is a computer without sound?
extremely annoying problem that i hope apple looks into and fixes
-andrew -
I'm a character error problem in firefox. How can I solve.
I'm a character error problem in firefox. How can I solve.
Hello haruntt, please be a little more specific about the issue. In order to better assist you with your issue please provide us with a screenshot. If you need help to create a screenshot, please see [[How do I create a screenshot of my problem?]]
Once you've done this, attach the saved screenshot file to your forum post by clicking the '''Browse...''' button below the ''Post your reply'' box. This will help us to visualize the problem.
Thank you! -
Hi All,
I am using Oracle OLE objects to connect to Oracle 9.2 DB
The NLS Language for the Database is AMERICAN_AMERICA.AR8ISO8859P6
the client is using also the same NLS.
When I retrive the information using OO4 some varchar2(Arabic Language) are return incorrectly from the DB, however when I use ADO on the same clinet it's correctly retrive all Data.
I've only on home at my PC, and its NLS language is correct, even when I use SQL*Pluse the characters are displayed correctly.
I also retrieved the NLS_LANG from the application using "SELECT USERENV ('LANGUAGE') FROM DUAL"
and it was correct using ADO and OO4.
Of course I've checked the registry value NLS_LANG and it's also AMERICAN_AMERICA.AR8ISO8859P6
Any Help????I think after all it is a problem with the either:
a. OS installer, which should really try to delete fonts which are duplicated by new system fonts
b. OS which should give precedence to new system fonts over old system fonts where there are two the same, especially when the system fonts are in /System/Library/Fonts and the old ones are in /Library/Fonts
The major annoyance is that this problem appeared with Leopard and took me hours of searching to figure out its origin - when you don't know if it is a character entry problem (which I thought) or a character display problem (which it turned out to be). In the end the fix was simple - delete the superceded fonts. -
Character display problem latin characters
For some reason old fonts show latin characters when i type "o/" and "l/". The problem seems confined to old fonts (at least Geneva; Monaco; New York), so I guess it is a bug?
I think after all it is a problem with the either:
a. OS installer, which should really try to delete fonts which are duplicated by new system fonts
b. OS which should give precedence to new system fonts over old system fonts where there are two the same, especially when the system fonts are in /System/Library/Fonts and the old ones are in /Library/Fonts
The major annoyance is that this problem appeared with Leopard and took me hours of searching to figure out its origin - when you don't know if it is a character entry problem (which I thought) or a character display problem (which it turned out to be). In the end the fix was simple - delete the superceded fonts. -
Hi All,
When ever capital 'w' (i.e W, plain,Dialog and size 11) is first character in a text field left upper portion is not visible.But if I change any of these properties( i.e plain,Dialog, size 12) there is no problem.
Can any body suggest me how can I display 'W' correctly with these propeties(i.e W, plain,Dialog and size 11).
Thanks in advanceI think after all it is a problem with the either:
a. OS installer, which should really try to delete fonts which are duplicated by new system fonts
b. OS which should give precedence to new system fonts over old system fonts where there are two the same, especially when the system fonts are in /System/Library/Fonts and the old ones are in /Library/Fonts
The major annoyance is that this problem appeared with Leopard and took me hours of searching to figure out its origin - when you don't know if it is a character entry problem (which I thought) or a character display problem (which it turned out to be). In the end the fix was simple - delete the superceded fonts. -
Delimited output problem at the time of writing in to text file
Hi ,
I am using matrix stayle design for my reports when i am generating reports in delimited format i am getting Delimited output problem(DR.Watson ERROR) at the time of writing in to textfile.Hi,
Try with new desformat delimiteddata which is available with Report 6i patch 11.
Thanks
Oracle Reports Team -
Debian Linux character recognition problem
Maybe this shouldn't be on this forum, but perhaps someone can help me...
I have Jrun 3.1, java 2 1.4 and Debian Linux.
On our test server everything was hunky dory, running perfectly.
But once everything was on the real server, we've had a character recognition problem. All of the higher characters are just replaced by a y or a ?.
I'm pretty sure that we can exclude java from the problem, the i18n.jar, which I believe holds all the international stuff is there and in the classpath (exactly as on the test server) and jrun is exactly as on the test server because we copied every folder as it was.
Therefore I think we can bring it down to Linux (Debian).
I cannot find where to look in Debian for any kind of keyboard or locale problem. Anyone know what to do?
kbdconfig command doesn't exist on our system.
Any help greatly appreciated.
We are in Italy, by the way.
Thanks.If you check out the default file encoding you'll find that it's 7-bit ASCII; no characters > '\u007F' come out as they should. This applies as well to compiling as to running.
You can compile with another character encoding using the command line options, like: "javac -encoding ISO-8859-1 package/YourClass.java" (available at least in 1.4) and "java -Dfile.encoding=iso-8859-1 package.YourClass". -
Oracle 8i us7ascii character set problem - help required urgent.
Hi frnds,
I have a oracle 8i database server installed on sun solaris os. The database character set is us7ascii. In one of the tables TIFF images are stored in a long column. I m trying to fetch these images using oracle 9i client and visual basic(oracle ODBC drivers). But i m unable to do so. I can not fetch special characters.
Is it because of the character set problem? but when i run my code on the server itself, i m able to fetch the images. I tried to fetch the images using oracle 8 i client on windows XP machine but could not do so. Are there any special settings that i have to do on the client side?Indeed, it's an ODBC issue. Read this statement from Oracle:
From ODBC 8.1.7.2.0 drivers onwards it's NOT possible any more to
"disable" Characterset conversion by specifying for the NLS_LANG
the same characterset as the database characterset. There is now
ALWAYS a check to see if a codepoint is valid for that characterset.
Typically you will encounter problems if you upgrade an environment
that has NO NLS_LANG set on the client (or US7ASCII) and the database
was also US7ASCII. This incorrect setup allowed you to store characters
like èçàé in an US7ASCII database, with the new 8i drivers this is not possible
any more.
Basic problem is the 'wrong' characterset US7ASCII in the database. As long as no characterset conversion happens (that's the case on the unix server), special characters are no problem.
Werner
Maybe you are looking for
-
Reminders not showing up in Notification Center (iOS7)
Having an issue wherein my Reminders are not showing up in the Notification Center. Reminders are syncing just fine between my Mac and iOS apps, but, for some strange reason, they are not making it over into NC. I have no problems with Calendar Eve
-
How to make folders for photos
How can I sort my photos out into folders so that I can choose which photos I want as my desktop. At the moment it wont let me choose a specific folder to have rotating as my desktop so I'm having to have all my photos on rotation. Help anyone?!?!?!
-
Why console jar program does not run?
Hi, I built a console application on windows. It works fine when I run it on JBuilder. It has a timer to run the Socket Connection with another server and exchange data for every minute. I built the archives - both native executable jar file and cons
-
I would like to keep my CC. However my system won't take the new CC versions of my software (windows 7 or later etc.). And I do not want to spend 1500 or more on a new system. CS6 works just fine on my system. My question is, if I keep CC, is CS6 sti
-
How can I access USB drive on AirPort Extreme with iPad
Good day. I recently purchased an AirPort Extreme, and am very pleased. I thought I would take advantage of the ability to store files and videos of my children on my USB drive on the router. Installation was flawless, however, i cannot access the US