Unicode I/O problem

Hi,all
I want to store some unicode characters in a file and then read it again and insert it to an html file.
Everything is ok in win me and I can see unicode text properly in a browser but in win2k advanced server everything will be changed to "????????".
would you pls help me solve my problem?
many thanks in advance
Bahram
Here my code is attached...
public static void makeBreakFile(String headLine,String img,String body){
String str="";
FileOutputStream outStream; // declare a file output object
PrintStream p; // declare a print stream object
try{
FileInputStream fstream=new FileInputStream("./uploadfiles/newstemp.htm");
InputStreamReader ir = new InputStreamReader(fstream);
BufferedReader in = new BufferedReader(ir);
outStream = new FileOutputStream("./uploadfiles/breaknews.htm");
OutputStreamWriter or = new OutputStreamWriter(outStream);
BufferedWriter out = new BufferedWriter(or);
//p = new PrintStream( out );
while ((str=in.readLine())!=null){
if (str.trim().compareTo("<!--headline part-->")==0){
out.write(headLine);
out.newLine();
else if(str.trim().compareTo("<!--img part-->")==0){
if (img!=""){
out.write("<img border=0 src="+img+">");
out.newLine();
else if(str.trim().compareTo("<!--body part-->")==0){
out.write(body);
out.newLine();
else{
out.write(str);
out.newLine();
// p.close();
out.flush();
in.close();
out.close();
catch (Exception e)
System.err.println("file input error");
e.printStackTrace();
}

I'm not sure, but I think you may need to say somewhere (either when you create your read/writer or when you do that actual read/write) what style your text is. Something like
File yourFile
Writer w = new PrintWriter(yourFile,"Unicode");
'Unicode' like that is obviously not going to work, I bet you need to give it a version standard.
Check out the java trail for "reading, writing (but not 'rithmatic)" on this site

Similar Messages

  • More Cf + MySQL 5 + Unicode/UTF-8 Problems

    Here is the problem:
    I am using a MySQL database that store data in Unicode/UTF-8
    (the website/database are in Lao).
    Settings:
    CF 7.0.2
    MySQL 5.0.26
    MySQL Defaults: latin1_swedish_ci collation, latin1 encoding
    Database Defaults: utf8_general_ci collation, utf8 encoding
    These are same on my local computer and on the host
    (HostNexus)
    The only difference is that my CF uses
    mysql-connector-java-3.1.10 driver while the host uses MySQL 3.x
    driver (org.gjt.mm.mysql.Driver class).
    On my local computer everything works just fine, even without
    any extra CF DSN settings (i.e. connection string and/or JDBC URL
    do not need the useUnicode=true&characterEncoding=UTF-8 strings
    added to show Lao text properly).
    On the host, even with the
    useUnicode=true&characterEncoding=UTF-8 added (I have even
    tried adding
    &connectionCollation=utf8_unicode_ci&characterSetResults=utf8
    to the line as well), I only get ??????? instead of Lao text from
    the db.
    The cfm pages have <cfprocessingdirective> and
    <cfcontent> tags set to utf-8 and also have html <meta>
    set to utf-8. ALl static Lao text in cfm pages shows just fine.
    Is this the problem with the MySQL driver used by the host?
    Has anyone encountered this before? Is there some other setting I
    have to emply with the org.gjt.mm.mysql.Driver class on the host?
    Please help!

    Thanks for your reply/comments, Paul!
    I also think it must be the db driver used on the host... I
    just don't understand why the DSN connection string
    (useUnicode=true&characterEncoding=UTF-8 [btw, doesn't really
    matter utf8 or UTF-8 - works with both; I think the proper way
    actually is UTF-8, since that is the encosing's name used in
    Java...]) wouldn't work with it??? I have the hosting tech support
    totally puzzled over this.
    Don't know if you can help any more, but I have added answers
    to your questions in the quoted text below.
    quote:
    Sabaidee wrote:
    > Here is the problem:
    > I am using a MySQL database that store data in
    Unicode/UTF-8 (the
    > website/database are in Lao).
    well that's certainly different.
    I mean, they are in Lao language, not that they are hosted in
    Laos.
    > Database Defaults: utf8_general_ci collation, utf8
    encoding
    how was the data entered? how was it uploaded to the host?
    could the data have
    been corrupted loading or uploading to the host?
    The data was entered locally, then dumped into a .sql file using
    utf8 charset and then the dump imported into the db on the host,
    once again with utf8 charset. I know the data in the database is
    correct: when I browse the db tables with phpMyAdmin, all Lao text
    in the db is displayed in proper Lao...
    > The only difference is that my CF uses
    mysql-connector-java-3.1.10 driver
    > while the host uses MySQL 3.x driver
    (org.gjt.mm.mysql.Driver class).
    and does that driver support mysql 5 and/or unicode?
    I am sure it does support MySQL5, as I have other MySQL5
    databases hosted there and they work fine. I am not sure if it
    supports Unicode, though.... I am actually more and more sure it
    does not... The strange this is, I am not able to find the java
    class that driver is stored in to try and test using it on my local
    server... I have asked the host to email me the .jar file they are
    using, but have not heard back from them yet...
    > On my local computer everything works just fine, even
    without any extra CF DSN
    > settings (i.e. connection string and/or JDBC URL do not
    need the
    > useUnicode=true&characterEncoding=UTF-8 strings
    added to show Lao text
    > properly).
    and what happens if you do use those? what locale for the
    local server?
    If I use just that line, nothing changes (apart from the 2 mysql
    variables which then default to uft8 instead of latin1) -
    everything works just fine locally.
    The only difference I have noticed between MySQL setup on my
    local comp and on the host is that on my comp the
    character_set_results var is not set (shows [empty string]), but on
    the host it is set to latin1. When I set it to latin1 on my local
    comp using &characterSetResults=ISO8859_1 in the JDBC URL
    string, I get exactly same problem as on the host: all ???????
    instead of Lao text from db. If it is not set, or set to utf8,
    everything works just fine.
    For some reason, we are unable to make it work on the host:
    whatever you add to the JDBC URL string or enter in the Connection
    String box in CF Admin is simply ignored...
    Do you know if this is a particular problem of the driver
    used on the host?
    > The cfm pages have <cfprocessingdirective> and
    <cfcontent> tags set to utf-8
    > and also have html <meta> set to utf-8. ALl static
    Lao text in cfm pages
    > shows just fine.
    db driver then.
    I think so too...

  • Unicode kernel upgrade problem in XI server

    Hi
    I'm trying to upgrade the Brtools in XI server and getting the following problem:
    rx2n0v4:xdvadm 23> SAPCAR -xvf DBATL640O92_45-10002837.SAR
    stderr initialized
    processing archive DBATL640O92_45-10002837.SAR...
    --- Unicode interface [u16_get.c line 233] pid = 6963 :
    Invalid UTF-8 encountered by fgetsU16 (fileno 0x4)
    fd
    Characters previously read:
    0043 0041 0052 0020 0032 002e 0030 0031
    0052 0047                      030 0031
    --- Unicode interface -
    End of message -
    Illegal byte sequence DBATL640O92_45-10002837.SAR
    Couple of times, i downloaded the kernel today and tried but get the same error. Here XI (6.40)is the unicode server and i downloaded the unicode kernel from sapnet (brtools and SAPCAR kernel). I tried with version 7.00 kernel but get the same problem.
    Any solution of this problem?
    Regards
    Amar

    Confusion About SP16 Unicode Kernel Patch/Upgrade
    Problem with updating XI 3.0 (Kernel etc.)
    Check this might be useful.

  • BLOB unicode file name problem

    Hi,
           I am trying to upload pdf file into SecureLOB column, I am getting error when I try to upload file name/directory  with unicode char, for other files/directory it works fine.
    w_src_loc := bfilename('LDIR', in_file_name);
      dbms_lob.open(w_src_loc, dbms_lob.lob_readonly);
    dbms_lob.open gives file not found error in oracle 11g,
    Can any one guide me what may be the problem?
    DB's character set:
    NLS_CHARACTERSET
    AL32UTF8
    NLS_NCHAR_CHARACTERSET
    AL16UTF16
    P.S. Oracle is running in Windows and unicode (chinese) enabled OS.
    -Raj

    > I am getting error when I try to upload file name/directory  with unicode char,
    ERROR? What Error?
    I do not see any error.
    my car won't go
    tell me how to make my car go.
    How do I ask a question on the forums?
    https://forums.oracle.com/message/9362002#9362002

  • Unicode Migration - Password Problem

    Hello, friends.
    I've migrated an 7.6.06.03 instance to UNICODE, using db_migratecatalog.
    My original DBA password had 10 characters. After migration, I couldn't log into the new UNICODE version, neither through ODBC (unicode or not) nor with SQL Studio. But with dbmcli I was able to do a sql_connect with the old password and then change the DBA password to 9 chars. It's the new max password length, and I can't define a password greater than 9 chars.
    The problem is that our applications are configured with the 10 chars password, and it can't logon anymore.
    Is there a solution to this, or will I have to reconfigure my applications? (would be a pain... )
    Thanks!

    Hello Victor,
    yes there is a password length limitation:                            
    Passwords may not have more than 9 characters.                                                                               
    For more information please have a look at documentation at following link:    
    http://maxdb.sap.com/doc/7_6/default.htm                                                                               
    -> Basic Information -> Concepts of the Database System               
    -> Administration -> Users, Authentication and Authorizations         
    -> Conventions for User Names and Passwords   
    or http://maxdb.sap.com/doc/7_7/default.htm   
    -> Database Administration -> Managing Users               
    -> Conventions for User Names and Passwords         
    Thank you and best regards, Natalia Khlopina

  • Unicode - Japanese Char problems on EN logon

    Hi Everyone,
    We recently upgraded our system, from a non-unicode to a unicode system.  Whenever i view a SAPscript report using english logon that contains both japanese & english characters in one field, the print preview is ok, displaying correct data in both languages. The problem arises when i try to print the report. All japanese characters are garbled, while all english characters are still ok.
    I tried logging in using japanese language, and printed a japanese report that uses both characters, and everything was ok, in both print preview & hardcopy printout.
    BTW, we're using version 640 for our SAP GUI, with patch level 19.
    Hoping for your inputs. Thanks in advance!

    Hi,
    If your system is unicode enabled, you should use true type fonts in the paragraph format to display the multi language characters. In the japanese language form did you use any special type of font types you use? Normally all the special font types will support english and not all the english fonts will support the local language characters.
    Since the output is printing fine with the Janpanese language there should not be any problem with the printer drivers, otherwise we need to check the drivers also.
    Hope this helps you

  • ECC 6.0 - Non-Unicode and BI 7.0 - Unicode any known problems?

    We are determing whether or not to do a unicode conversion during our upgrade from BW 3.5 to BI 7.0.  Our R/3 system is non-unicode and my company does not utilize languages other than English and is not expected to at any time in the near future.  This being said we are trying to determine whether or not we should go ahead and do the conversion prior to being forced to by SAP at some point in the future.  I was just hoping I could get some insight into whether there were known issues with running the two versions in conjuction with each other.
    Thanks in advance,
    John

    We have a customer running this scenario, it should be possible to do so. Just keep in mind to do extensive testing as there might be some notes which are not yet in standard ...
    Regards, Kai

  • Gujarati unicode font encoding problem in E-63

    I can´t read e-mails containing Gujarati Unicode Font in my E-63 even if I have selected Unicode for encoding. The same mail is easily rea dable in 6303i classic.Wat changes shud I do in my E-63 to enable for gujarati unicode font?

    Dear gujarati, Written below is the sample of "Shruti" Gujarati Unicode fonts: આ ફોન્ટ ’શ્રુતિ‘ યુનિકોડ ફોન્ટ છે.જે હું મારા નોકિયા E-63માં ઉકેલી શક્તો નથી. અક્ષરને બદલે માત્ર લંબચોરસ ચોકઠા જ દેખાય છે.આપનો ખૂબ આભાર. Thanks.

  • Unicode font / Hebrew problem

    Hello
    I use two different flash card programmes to learn Hebrew vocab.
    One has a setting for selecting the display font and one doesn't. Regardless of what font you choose it looks the same anyway. Both are synced over wifi.
    The problem is that in one of the apps there is a letter that appears correctly on the iMac but not on the iPad. It is a letter which looks like a "w" but in one case has a dot over the left hand stroke (sin) and in another over the right hand stroke (shin).
    It displays correctly on the other app.
    The dev says that they have no control over the appearance as only system settings are used for fonts on the iPad.
    Can anyone suggest a way around this problem, or any testing I can do to pinpoint the issue (I do not want to jailbreak etc the iPad, as some suggest is an answer). I have tried different things - even copying and pasted the Hebrew
    Many thanks if you can help!
    Deb

    Thanks for your reply.
    I've done some more investigating and it did not seem to be related to the choice of font. In fact, there were a few places where that particular letter appeared correctly.
    So I started retyping the letter on the iMac and syncing over and the letter displayed correctly. I therefore assume that it could be related to the keyboard layout that was used when entering the text (I downloaded the cards from an exchange). I can't think of any other explanation, though I don't know a lot about this sort of thing. Whenever I enter that letter on my own computer it displays correctly in iOS.
    Upshot is that I am retyping wherever the what should be a shin is appearing as a sin. A sin indeed!
    The choice of font does not appear to make much of difference when displaying Hebrew in iOS.
    Deb

  • SVN Merge - Another Unicode/UTF-8 problem

    When merging conflicts in Unicode/UTF-8 files (Java, XML, JSPX) the resulting file looses UTF-8 characters.
    This is yet another serious Unicode/UTF-8 bug in JDev. What is going on with Unicode/UTF-8 support? Currently, developing any fully "Globalized" application with JDev is "mission impossible"...

    Hi Steve!
    Thank you for info. In noticed that Trinidad 1.2.2, released 3 months ago, is not included in TP 2 also. So I understand that something commited on 20th of September also did not make to TP 2.
    Anyhow, god to know that we can expect better unicode support in TP 3 or so.

  • Minion vs Lucida grande: a unicode (sans) serif problem

    Have a book composed in Minion but some references demand Unicode letters (0289) for example.
    Fortunately Lucida Grande has the solution but it is sans serif und very invasive.
    Could not find it in Adobe Folio a serif font for a best solution neither information in a web search...

    You can use the Glyphs panel -- awkwardly, admittedly -- to check if the currently applied font has the glyph you're after. The Glyphs are in Unicode order (which are in hexadecimal, which adds to the fun), and if you hover the mouse over them, a little info window will tell you the unicode of the character under the pointer. If you start by selecting the 0289 Glyph in Lucida Grande, you can go back to the document, change the font of the selected text, go back to the Glyphs panel and see if there's an equivalent Glyph in each of the other fonts you've got, one by one. If there is one, it should appear selected in the Glyph panel.
    A quick check shows that there are several sans-serif fonts that have the glyph you want (including Lucida Grande, as you know, and Arial Unicode), but none of the really nice Adobe text fonts that come with Indesign (Garamond Premiere Pro, Minion Pro, Warnock Pro, Chaparral Pro). But Times New Roman does (at least, the version I've got on my Mac).
    And while Times New Roman is not a great match for Minion, it's better than Lucida Grande. At least it has serifs. If you can find a better one, do so.
    Here's an easy way to fix the missing characters while keeping Minion as your main font. First, set up a character style that specifies the font Times New Roman. Then create a GREP Style in your text paragraph style that applies your new character style to any occurrence of \x{0289}. Each 0289 character will change to Times New Roman throughout the document. Set up a similar GREP style for each other unicode character you have, changing it to a font in which that character exists.

  • Unicode hex input problem

    I have a MBP running Yosemite.  My partner has a MBAir running OSX 10.8.5 (M-Lion?)
    He needs to use some medieval characters in his writing as a grad student in ENglish.
    On both machines, we installed the Unicde Hex Input source and selected it.
    On my machine, I can use the OPTION-KEY + 4-digit-hex-code to produce the characters as desired.
    On his machine, with the OPTION-KEY held down, as you type each digit of the hex code, you get a different character, instead of one character after typing the 4-digit code.
    Any suggestions?
    Thanks,
    Dave

    Thanks, Tom -- I'll check it again as soon as I have access to the MBAir, but I'm pretty sure I checked that the U+ input source was selected.
    Also, regarding character viewer, even on my own machine (where U+ input works fine) I don't see any of the medieval charcaters in the character viewer, no matter which font (?) I pick from the left-hand list.
    For instance, here's a medieval character, produced through the OPTION+ method:  ꝑ (blown up to 18 pts to make it easier to see).  But I can't find it using the character viewer in Latin or character-like symbols. I think I may not understand how to use the character viewer correctly(?)  What is the relationship between the list of symbol-sets (if that's the right word) in the character viewer and the font that's selected in the editor I'm using?
    Thanks again,
    - dave

  • Easy DMS  - problem with  object linking (unicode client)

    Hi Gurus,
    I have a problem concerning linking a materialmaster to a DIR in a uniciode environment. I tested following scenarios:
    1) Easy DMS 6.00 SP10 non unicode  +  non unicode Backend  -->  no problem
    2) Easy DMS 6.00 SP10 non unicode  +  unicode Backend        -->  no problem
    3) Easy DMS 6.00 SP10 unicode        +  non unicode Backend  -->  no problem
    4) Easy DMS 6.00 SP10 unicode        +  unicode Backend         --> problem
    Following Problem appears in scenario 4:
    Our Material Number Format is ______-____-___ (6 digits - 4 digits - 3 digits), "Lexicographical" is disabled, "Leading Zeros" is enabled.
    When I type in material number "111111-2222-333" and press "check all objects and read description" Easy DMS reads the description for
    111111-2222-333 but after that easy dms changes 111111-2222-333 to 000001-1111-122 and when I try to save the DIR it tells me that 
    000001-1111-122 is not a valid material master.
    As I mentioned this only appears with the unicode client + unicode backend. Any Ideas?

    Hi David,
    please tell us which version of EasyDMS you use currently. If you do not use EasyDMS 6.00 SP10 I would kindly ask you to see SAP note 1105699 and download this SP from the Service Marketplace.
    Further please check if you have maintained the object link customizing correclty in your backend system. Therefore please see the information in the SDN WIKI area for DMS under https://www.sdn.sap.com/irj/sdn/wiki?path=/display/plm/ca-dms-Object+link
    Best regards,
    Christoph
    P.S.: Please reward points for useful information.

  • Problem with UTF-8 japanese on Win XP

    Hi,
    I have a Client/server application with a server coded in C++ and runing on HP workstation and the GUI in java runing in a web context via java webstart mechanism on PC machine with win XP sp2 OS.
    when logging into the HP workstation in japanese SHIFT_JIS and downloading the application japanese Charcters are displayed correctly on my PC.
    However when logging into the HP workstation in japanese with UTF-8 encodage and kaunching the application characters aren't displayed correctly only rectangle charcaters are displayed, when launching the GUI on HP workstation it displayed correctly.
    Can any one help me to resolve this problem.
    Regards,

    Both SHIFT_JIS and UTF-8 are character encodings. SHIFT_JIS encodes a superset of JISX-0208 to double-byte codepoints and JISX-0201 to single byte codepoints. UTF-8 encodes all of Unicode.
    The problem here is that you are relying on "default" encoding for a client-server application. This only works when the default encoding is the same on both ends.
    Go through your code, looking for everywhere where you convert to and from Strings, including reading and writing to IO Streams, and replace the methods you are using with equivalent methods that let you specify an encoding.

  • Create PDF with CONVERT_OTF in Unicode system

    Hi,
    I try to create a PDF file from OTF input with function module CONVERT_OTF.
    It worked in a non-unicode environment with problems.
    If I use the same coding in a unicode system (6.0) and OTF input
    contains real doublebyte unicode characters like arabian/greek characters,
    the PDF file shows wrong characters like "ÔÑÙàÜÐÕÞÙ Ôâé" instead of
    "&#1512;&#1489;&#1491;&#1500; &#1492;&#1510;&#1493;&#1512; %&#1500;&#1493;&#1506;&#1492;" or "&#1033;&#1034;&#1035;&#1036;&#1038;&#1039;&#1040;&#1041;&#1042;&#1043;&#972;ψχΩΨΧ".
    I enable the developer trace for CONVERT_OTF, but the trace also
    shows the correct unicode characters.
    If I create a PDF file with PDF Creater with the same input on my computer,
    PDF file looks fine. SAP PDF file uses Font enconding 'Windows', PDF Creator
    uses a 'Custom' font encoding.
    Any idea, that's going wrong here?
    I install TrueType fonts like described in SAP note 999712 with no success,
    but this note refers to SAP_BASIS 011, which is not yet available on SAP Marketplace
    (latest is 010 today).
    Is there any other configuration to enable PDF unicode support?
    Print preview from other SAP transactions looks fine with unicode characters.
    thanks for help
    /Tibor

    >
    Juraj Danko wrote:
    > Hi,
    > I have similar problem than you ... how have you solved it?
    > thanks
    > Juraj
    I found a solution, but I am not sure, if it was for this problem or
    output problem with for example PL in non-unicode systems.
    I created the input for CONVERT_OTF with CALL FUNCTION 'PRINT_TEXT'.
    PRINT_TEXT has to be called with DEVICE = 'PRINTER',
    DEVICE = 'ABAP' uses internally the wrong code page.
    You have also to set otf_options-tdprinter to a valid printer,
    if it is empty, the default printer from user settings is used.
    You can use code example from SAP note 413295.
    Before you call CONVERT_OTF, you can also check entries with 'FC' in OTF input.
    The font (see description of OTF format in SAP help) must be set like described in SAP note 144718.
    /Tibor
    Edited by: Tibor Gerke on Jan 13, 2011 10:29 AM

Maybe you are looking for

  • Why did my index.htm file generate blank? and other weirdness.

    Here's the story. Maybe someone can tell me where I made my mistake, or what happened. I'm numbering the steps for convenience in discussing this. 1) I started a new project, a WebHelp project. 2) I imported content in Word. 3) I created an index, gl

  • Performance of Sales order creation on Business Suite on HANA

    Hi, I understand that HANA column tables are read and insert optimized. I would like get some clarification on the following scenario. Assume that in the ECC (non HANA DB) the sales order creation process is taking few hours to complete due to the sh

  • How can I use Apple TV as second display, not mirror.

    I was told (and showed) by an apple "genius" that i could use apple tv with my own hd monitor as a second monitor to use in final cut and other media programs. so i got one, but the desplay setting will only let me use the mirror settings. anyone now

  • Problem building PetStore 1.1.2 with WebLogic 6.1

    I am trying to build the JPS-1.1.2 example using WLS 6.1 according to the instructions at: http://e-docs.bea.com/wls/docs61/petstore/bea_deployathon.html The build fails with the following message: [execon] Error: [jspc]: 2 file(s) failed: [execon] /

  • Why don't I see any presets in lightroom 4?

    I have a list of preset categories, but when I click there is nothing there.