On Sun, Apr 27, 2014 at 7:13 AM, Sugita Shinsuke <shinr...@gmail.com> wrote:
> Hi there
>
> I’d like to run Java code via Django.
>
> The Java code, javaprogram use like below.
>
> —
> java javaprogram [text] [file_name]
> —
>
> text is parameter. multi-byte character is also okey.
> file_name is generate file name.
>
> So, I run the stand-alone Python program like below could run fine.
> —
> java_file = ‘javaprogram’
> file_name = ‘filename’
> text = ‘あいうえお’ #Japanese character
> java_file_path = ‘/path/to/‘
> class_path = ‘-cp ' + java_file_path
>
> cmd = “java {0} {1} {2} {3}".format(class_path, java_file, text, file_name)

What version of Python? 2.x or 3.x?

Presumably your email client is converting plain single and double
quotes to smart quotes and backticks, and in your source code they are
plain single and double quotes - " and ', not “ and ‘.

Django does something explicitly to force management commands to be
ascii, see here:

https://docs.djangoproject.com/en/1.6/howto/custom-management-commands/#management-commands-and-locales

There was an old case to force Django to use UTF-8:
https://code.djangoproject.com/ticket/5877

It was closed wontfix on the basis that Django respects your locale,
which it no longer does by default. There are several workarounds
listed on the first link that will restore that behaviour. Within a
view code, the rules are different, it will activate either the
language that user requests (if supported and USE_i18N=True) or
LANGUAGE_CODE otherwise.

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFHbX1%2Bx%2BQ2CS4Hc9ifbddCGygZzhF3pK-Z0EMp%3DHtAHvTH_jQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to