Python论坛  - 讨论区

标题:[python-chinese] python 处理中文的问题

2007年12月04日 星期二 15:50

宇刘 liuy102在gmail.com
星期二 十二月 4 15:50:52 HKT 2007

ÎҵijÌÐò½«Ò»¶Îutf-8µÄÖÐÎIJåÈëµ½mysql£¬Ö±½ÓÔÚshellÖÐÔËÐÐûÓÐÎÊÌâ
·Åµ½crontabÀï³ö´í£¬×ÜÊÇ£º
ValueError occur: 'ascii' codec can't encode characters in position 0-5:
ordinal not in range(128)

ÊÇʲôÎÊÌâ°¡£¿
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20071204/df5f9fef/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年12月04日 星期二 16:52

liwei anbutu在gmail.com
星期二 十二月 4 16:52:37 HKT 2007

文件头上放
*-* coding:utf-8 *-*

On Dec 4, 2007 3:50 PM, 宇刘 <liuy102在gmail.com> wrote:
> 我的程序将一段utf-8的中文插入到mysql,直接在shell中运行没有问题
> 放到crontab里出错,总是:
> ValueError occur: 'ascii' codec can't encode characters in position 0-5:
> ordinal not in range(128)
>
> 是什么问题啊?
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>



-- 
Best Regards

Jerry Lee

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年12月04日 星期二 17:30

宇刘 liuy102在gmail.com
星期二 十二月 4 17:30:48 HKT 2007

Ô´´úÂëÀïûÓÐÖÐÎÄ

ÔÚ07-12-4£¬liwei <anbutu在gmail.com> дµÀ£º
>
> ÎļþÍ·ÉÏ·Å
> *-* coding:utf-8 *-*
>
> On Dec 4, 2007 3:50 PM, ÓîÁõ <liuy102在gmail.com> wrote:
> > ÎҵijÌÐò½«Ò»¶Îutf-8µÄÖÐÎIJåÈëµ½mysql£¬Ö±½ÓÔÚshellÖÐÔËÐÐûÓÐÎÊÌâ
> > ·Åµ½crontabÀï³ö´í£¬×ÜÊÇ£º
> > ValueError occur: 'ascii' codec can't encode characters in position 0-5:
> > ordinal not in range(128)
> >
> > ÊÇʲôÎÊÌâ°¡£¿
> >
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese在lists.python.cn
> > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
>
>
>
> --
> Best Regards
>
> Jerry Lee
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20071204/6d1a1a8e/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2024

    京ICP备05028076号