Hello Lloyd Dube

I fix 'utf8' to 'utf-8'.
But, same error happned.

ascii' codec can't decode byte 0xe3 in position 0: ordinal not in range(128)

"locale.getpreferredencoding() is ANSI_X3.4-1968"
is not the cause?

2014年5月7日水曜日 0時20分03秒 UTC+9 Lloyd Dube:
>
> That should be ".encode('utf-8') - it is separated by a dash.
>
>
> On Tue, May 6, 2014 at 4:31 PM, 杉田臣輔 <shin...@gmail.com <javascript:>>wrote:
>
>> Hello
>>
>> Thank you for replying.
>> I tried to use the ".encode('utf8')" method before.
>>
>> I also tried your suggestion. But error happened like below.
>>
>> 'ascii' codec can't decode byte 0xe3 in position 0: ordinal not in 
>> range(128)
>>
>>
>>
>>
>> 2014-05-06 17:10 GMT+09:00 Hannu Krosing <ha...@2ndquadrant.com<javascript:>
>> >:
>>
>>>  On 05/06/2014 08:28 AM, Sugita Shinsuke wrote:
>>>
>>> ...
>>>  
>>>  
>>>> If it is the cause. Can I change encode type of locale.
>>>> getpreferredencoding?
>>>>  
>>>  ...
>>>
>>>    > 
>>>>> > 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) 
>>>>>
>>>>    You can check if encoding the arguments manually works:
>>>
>>> cmd = "java {0} {1} {2} {3}".format(*[s.encode('utf8') for s in 
>>> (class_path, java_file, text, file_name)])
>>>
>>>
>>> Cheers
>>>
>>> -- 
>>> Hannu Krosing
>>> PostgreSQL Consultant
>>> Performance, Scalability and High Availability
>>> 2ndQuadrant Nordic OÜ
>>>
>>>  
>>  -- 
>> 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...@googlegroups.com <javascript:>.
>> To post to this group, send email to django...@googlegroups.com<javascript:>
>> .
>> 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/CAJ5zBj6H-HE60KJpB4-KbQkE9sY5Hri_vnQApeSPGSbkzLMV9g%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAJ5zBj6H-HE60KJpB4-KbQkE9sY5Hri_vnQApeSPGSbkzLMV9g%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Regards,
> Sithu Lloyd Dube 
>

-- 
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/b3db679e-ce93-4508-b0ed-0127544b9b27%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to