Re: can't get correct chinese character through crontab execute, but wroks fine by manual

From: Rich Gibbs (rgibbs_at_REMOVEalumni.CAPSprinceton.edu)
Date: 01/17/05


Date: Sun, 16 Jan 2005 23:42:54 -0500

cbac said the following, on 01/16/05 21:53:
> Hi All!
>
> I have a java class which will check the abnormal appliaction cases
> in my oracle database and then send email to notice the people in
> charged. I scheduled it in the crontab of the application server
> (Solaris 8 on SunFire 280).
>
> The email content should be in Traditional Chinese (for our local
> outlet manager). Basicly, whole system works fine if I manually execute
> the java class throught a xxx.sh script, but all of the chinese
> characters become "??" if the the xxx.sh was executed through crontab.
>
> If I can't find the answer, I will use TimerTask to implement
> another class to do the schedule things. Any other suggest?
> Thanks in advance!
>

I don't have any specific knowledge about the use of Chinese characters
in Java, but this sounds like a case of a fairly common, more general
problem.

The initial conditions under which a 'cron' job is executed are
typically _not_ the same as those initially set up for an interactive
shell. In particular, start-up scripts may not be executed, and
environment variables may not be set, or set differently (especially
PATH).

Perhaps running through crontab is not giving you a setting that is
needed to map the Chinese characters correctly.

-- 
Rich Gibbs
rgibbs@alumni.princeton.edu


Relevant Pages

  • Re: How to select a menu item programatically?
    ... This Java class from Java Swing, so I am not sure how it relates to ... any menu item without this class functionality. ... option and execute it if MainMenu or ContextMenu are available in UI. ... Do you want to change standard Windows visual feedback? ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: How to make a file "executable" at runtime?
    ... > I want to change its permission so it can be executed ... The FilePermission 'execute' permission simply allows 'Runtime.exec' to ... you cannot use a standard Java class to directly ... You will need to use 'chmod', either in command form, ...
    (comp.lang.java.programmer)
  • Re: Compiling and Executing Java class from the Web Browser
    ... compile and execute the java class from the click of a button from ... mweb browser. ...
    (comp.lang.java.programmer)
  • Re: Stored Procedure Error ,No ResultSet was produced
    ... > I call a Stored Procedure from my Java Class File.But i get this ... produce any ResultSet (i.e. if you execute it in Query Analyzer you'll ... executing use execute(). ...
    (microsoft.public.sqlserver.jdbcdriver)