Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: Problems with writing EUC-JP/Unicode to console or file: msg#00100

db.postgresql.jdbc

Subject: Re: Problems with writing EUC-JP/Unicode to console or file

I suspect that your machine's default encoding and the encoding used by
your Java program doesn't match. When you write on the web, the browser
knows the correct encoding to use from the HTTP headers (which BTW you
could consult to see what encoding you are writing with). But when you
write a file and read it in a console, the encoding is known only if you
tell it to the programs you use... i.e. explicitly tell to your Java
writer code what encoding to use, and explicitly tell to the editor what
encoding to use when opening the file. Otherwise they'll use their
default encodings, which might not match.

Cheers,
Csaba.


On Mon, 2003-06-23 at 11:36, Jean-Christian Imbeault wrote:
> Csaba Nagy wrote:
> > This sounds like your terminal can't display that character.
>
> Hum ... good idea. But I don't think this is the problem in my case as I
> am using the japanese version of Windows 2000.
>
> Also if I hard-coded the string to be written then it is displayed fine
> on the console or in the file, like this:
>
> String string = "ー";
> System.out.println(string);
>
> The above code prints out fine.
>
> But if 'string' is gotten from the database it does not display properly
> when printed out or written to file. But strangely enough it does
> display properly in GUI components.
>
> Maybe the GUI and the OS use different, and incompatible, unicode fonts?
>
> I'm thinking that the unicode byte representation of "ー" in the
> database and does not map to a valid character in the font set that my
> OS uses? That or the code point (is that the right word?) that pg uses
> for this character and is the not the same as Java uses? (I remember
> some talk about the unicode translation being moved from the driver to
> the back end and some changes in the translation tables or something
> like that?)
>
> I'm really at a loss here and any advice on what I can do to find the
> root cause and hopefully a fix for this are very much appreciated as my
> application depends on being able to write this character to file.
>
> Thanks!
>
> Jean-Christian Imbeault
>



---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
qnx.openqnx.dev...    gcc.libstdc++.c...    solaris.opensol...    information-ret...    misc.misterhous...    web.catalyst.ge...    apache.webservi...    redhat.release....    hardware.lirc/2...    kernel.autofs/2...    technology.sust...    linux.vdr/2003-...    editors.lyx.gen...    org.user-groups...    netbsd.devel.pk...    xdg.devel/2004-...    version-control...    jakarta.slide.d...    debian.packages...    creativecommons...    ports.ppc.embed...    bug-tracking.bu...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe