Two SWING apps show different UNICODE bahaviour

We have developed two SWING applications. In both of them we save information by writing to disk using UTF-8 format. When the files are read back and displayed using JTextField then one of the applications is able to display the (Bengali) characters properly but the other applications is displaying garbage.
We are using Java (JRE) version 1.5.0_01. The Unicode font (Likhan.ttf) is kept under the directory "JRE/lib/font/fallback". The files written to disk are text (XML) files.
Any idea what we might be doing differently in one application from the other?

UNIX ?
1. check user locale
it should be xx_XX.UTF-8. xx_XX - doesn't matter, but UTF-8 is important.
e.g.
LANG="en_EN.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_ALL=
2. try to compile you class with -encoding utf-8 option
javac -encoding utf-8 Your.java
3. try to output some text in Bengali to JTextField directly from code to understand where exactly the problem arise.
4. check system property file.encoding
class Enc {
     public static void main(String[] args) {
          System.out.println(System.getProperty("file.encoding"));
}how do you read data from file? do you specify encoding directly?

Similar Messages

  • Two SWING apps show different bahaviour

    We have developed two SWING applications. In both of them we save information by writing to disk using UTF-8 format. When the files are read back and displayed using JTextField then one of the applications is able to display the (Bengali) characters properly but the other applications is displaying garbage.
    We are using Java (JRE) version 1.5.0_01. The Unicode font (Likhan.ttf) is kept under the directory "JRE/lib/font/fallback". The files written to disk are text (XML) files.
    Any idea what we might be doing differently in one application from the other?

    UNIX ?
    1. check user locale
    it should be xx_XX.UTF-8. xx_XX - doesn't matter, but UTF-8 is important.
    e.g.
    LANG="en_EN.UTF-8"
    LC_CTYPE="en_US.UTF-8"
    LC_ALL=
    2. try to compile you class with -encoding utf-8 option
    javac -encoding utf-8 Your.java
    3. try to output some text in Bengali to JTextField directly from code to understand where exactly the problem arise.
    4. check system property file.encoding
    class Enc {
         public static void main(String[] args) {
              System.out.println(System.getProperty("file.encoding"));
    }how do you read data from file? do you specify encoding directly?

  • Cannot work with two Swing app. at the same time.

    Hi guys,
    I bring this problem here may somebody experienced that.
    I developed two client side applications(applets). Locate them on Apache/Tomcat. There is also a Index.html file with two links, so when user clicks on each link the associated application will downloaded on his/her PC and ready to work. (In index.html I used JavaScript function window.open(?) to load the applications)
    Now please see this scenario:
    1-I ran/loaded both application in two separate browsers(IE5.5). And tried to work with them(minimized one and work with another). Soon I faced unexpected frizzing/locking or very slow running on both applications.
    2-Then closed/killed one of them(killed IE). Then re-executed same application again. The application loaded with the last activated screen . Seems it never killed and it was still alive.
    3- The only way to successfully working is one by one. Means execute & work with one, then kill that, and then execute and work with another.
    To Debug:
    When both applications were running(each on it?s own IE), I opened the Task Manager and saw there was only one IEXPLORER.EXE was running, also there was only one Java VM (a little bird icon) on right-bottom of the screen.
    I believe this causes the problem. Seems they both running in the same session. Since I opened two applications in two IE I was expected to see two IEXPLORER.EXE with two JVM. Am I right? Do you think so?
    Note that the two app. have no Communication with each other.
    Any way, Now I am seeking to find the solution. My primary mind says probably I should not use window.open(..) in index.html to load the applications.
    Would appreciate any command on this.

    I am also facing the same problem !
    Since this may be a very late reply , if any body has a solution pls share!
    What I understand is that when we use javascript:window.open() it opens a new browser window
    but under same JVM. This is helpful if we need to have a 'Close window' button/link in the newly opened window and use javascript:window.close() there. Then browser will not show us the confirmation dialog box 'Webpage you are viewing is trying to close the window. Do you wish to Proceed?'
    But if we want a new JVM for each opened link and also donot want the popup dialog to be displayed when we close the browser from there..what do we do??

  • Two Related APPs with different session?

    Hi all!
    I have two apps (in a different workspace) linked by a tab. And whenever i switch between them, apex assigns a new session id.
    The url given by me to the tab includes the &SESSION.
    Is there any way to maintain the session??
    Thanks!!!

    No, see cookies and sessions
    Scott

  • Two same reports showing different output ??

    Hi
    Irregularity in two reports
    I developed a vendor liabilities aging report with lfa1-lifnr not maindatory,
    lfb1-bukrs obligatory , bsik-budat obligatory & report is working fine with
    total & all months total are displayed . I want to display por org.
    I added a new field LFM1-ekorg (Pur. Org ),
    ( no other table except lfm1 has ekorg field, link is using lifnr )
    after that report is showing less lifnr and also month amount and total is varying.
    I fetched lifnr, ekorg from lfm1 the for all entirs in bsik with lifnr equality & then
    lifnr from lfa1.
    I checked a database tables.
    Why so ?? Please

    Hi,
    Well am not sure if i understood your question properly. May be its something to do with order of selection from the tables. If so try like this
    select lifnr ekorg
    from lfm1
    into it_lfm1
    where ekorg = p_ekorg.
    select *
    from bisk
    into corresponding fields of it_bisk
    for all entries in it_lfm1
    where lifnr = it_lfm1-ekorg
    bukrs in s_bukrs
    budat in s_budat.
    By this way you can use purchase organisation also in the report.
    Regards,
    Vik

  • How can i use two channels to show different voltages in DAQ ?

    my problem is that when i choose different channels to read the outputs from my sensors, it ignores the channels which i have choosen 0 or 1 and it puts 0 channel only for both sensors. and the result is one same reading at both output guages, one reading is steady and the other is fluctuating. how can i make it recognize each one differently, is the proplem at my programme ? help me please
    Attachments:
    fin.vi ‏58 KB

    Greetings,
    AI Waveform Scan.vi and AI Sample Channel.vi each have a Channel(s) input. You do not have anything wired to these inputs. By default, these inputs are both Channel 0. You should wire "0" to one of these inputs and "1" to the other.
    Good luck with your application.
    Spencer S.

  • HT1937 iCal app showing different today's date to my main menu date?

    Whu my iCal today's date is not identical to the date displays on my main menu bar. It only happens today 29th Dec 2012.

    Today is not December 29th, why do you believe it is?

  • How can I update the apps. with the new iTune, that's really silly especially I have two iTune account for different countries

    I used 2 iPhones and a iPad, 2 Apple ID for different countries so that I can download apps. from different country.  Its a pain and sometimes no possible to update the apps. on the ISO devices.  Apple really needs to fix this aspect.  Also the new iTunes is so difficult to use, please bring back the old one.

    When Itunes opens
    1) Click on drop dow list button top left under the player controls
    2) Select Apps
    3) At the bottom right there are two buttons, Check for updates and Get More Apps
    An Alternative is when iTunes opens in the top menu Click on View, Show Sidebar. Then you will see your apps page as in itunes 10. Click on that option and as before you should have two buttons, Check for updates and Get More Apps.
    NB this is all within Itunes NOT the iTunes Store

  • I had an app previously, but now it shows I do not. How can I retrieve this, since I've already paid for it? I have 2 photos- one showing it in my cloud- and two the app itself. Please help

    I had an app previously, but now it shows I do not. How can I retrieve this, since I've already paid for it? I have 2 photos- one showing it in my cloud- and two the app itself. Please help

    redownload it,, either by syncing with iTunes or directly from your phone using the app store.

  • I bought two in -app purchases for 9.99$ each. they never showed up on the game, i emailed GREE, inc and they said to get a refund how do i go about this? i have the emails for proof.

    I bought two in -app purchases for 9.99$ each. they never showed up on the game, i emailed GREE, inc and they said to get a refund how do i go about this? i have the emails for proof.

    Contact iTunes Store support staff through the report a problem links in your account history or,
    iTunes Customer Service Contact - http://www.apple.com/support/itunes/contact.html > Get iTunes support via Express Lane > iTunes > iTunes Store

  • The screen where my apps show on all the pages is not letting me drag them. The screen looks kind of gray. What do I do to be able to move them to different home screens, and check, and uncheck the apps in the list

    The screen where my apps show on all the pages is not letting me drag them. The screen looks kind of gray. What do I do to be able to move them to different home screens, and check, and uncheck the apps in the list

    The specific demo would need to provide code for touch events.
    http://www.w3.org/TR/touch-events/

  • I want Photoshop and InDesign- If I buy two "single app" subscriptions it is $40/month but if I buy the single app subscription for InDesign and the Photography package it is $30/month. Am I missing something? Are these different versions of Photoshop?

    I want Photoshop and InDesign- If I buy two "single app" subscriptions it is $40/month but if I buy the single app subscription for InDesign and the Photography package it is $30/month. Am I missing something? Are these different versions of Photoshop?

    Hi,
    No it's the same Photoshop .Photography program is just a temporary promotion pack with Photoshop and Lightroom  and it can end anytime .So you can buy Indesign and photography to have Indesign,Photoshop and Lightroom .
    Regards,

  • TS1424 My app store shows different apple Id. I changed the ID in general settings under app store. Still no changes. Can't update apps now

    Apps store on my iPad shows different apple ID. I changed the ID under general settings for apps store, but it didn't help. Still see different ID when entering the store. Now I can't update apps and resetting iPad doesn't help. What to do?

    Use the correct login/password that the app was purchased with.

  • How do I configure my iPhone to show different colours for my two calendars both from separate email accounts, both Exchange.

    How do I configure my iPhone to show different colours for my two calendars both from separate email accounts, both Exchange.

    It does so by default... what's the issue?

  • TS3376 The find my iPhone app shows my iPad and iPhone in a totally different location about 100 miles away and my devices are in my lap? I'm confused ...

    The find my iPhone app shows my iPad and iPhone in a totally different location about 100 miles away and my devices are in my lap.... I'm confused ...

    Any thoughts on this , I'm worried that someone has cloned my device Id  and is phishing , or would there be just a major glitch in the GPS ? I have turned off the location app and turned it back on to see if it was a glitch still comes up to the same location about 100 miles way to a place I have never been.  Help !

Maybe you are looking for

  • Colour Profiles no longer work in Indesign CS5

    I have upgraded to cs5 and I am printing in Indesign using a Epson 3800, my old colour profiles no longer work (There is a cyan cast and everything is really saturated). The same profiles work fine through photoshop. This profile worked in Indesign P

  • Can't edit outlook email in HTML- whole message replaced with "undefined".

    In editing the html of messages in Outlook using Firefox browser, I click on options -> edit in HTML and whether or not I do anything to change the email whilst in the HTML editing option, as soon as I click on Rich Text to check the formatting etc t

  • How can I import iphoto projects (books) into Iphoto?

    My un-backupped Mac crashed, and I had the files recreated professionally. Now I want to import my books back into iPhoto, but either I am trying with the wrong files, or I am doing it wrong. Anyway I cannot import the "project.db" files, which the M

  • How to remove interlacing Premiere is adding on export?

    I am using a Mac, and the first CC. Processor: 2.66 GHz Intel Core 2 Duo Memory: GB 1067 MHz DDR3 Graphics: NVIDIA GeForce 9400 256 MB When ever I export video, it comes out interlaced. Doesn't matter what size or codec. I also followed the steps her

  • RandomAccessFile writes only around 2024  lines!

    Hi all, I have a slight problem. I have created a little program that helps me with some processing. I had a file with a list of 8000 products (some occuer more than once), and a seperate file with a list of prices for each of the products (in mixed