Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Unicode error only at reboot

By
Franco A.
on 2/4/15, 11:04 AM 486 views

Hi,

I have Odoo installed from github on an Ubuntu 14.04 machine. Odoo starts at boot with a script that I copied from the /debian/init file.

I built a custom module that reads file names from a directory on the server and lists them. I checked all possible unicode naming problems there, I hope.

My problem is that when I first boot the machine, log into Odoo and go to where my module should display file names I get an error "UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3: ordinal not in range(128)"

That character is a non ascii one.

The strange thing is that if I stop odoo and then restart it the problem goes away and file names get read correctly.

Any help?

Thanks,

Frank

0
Franco A.
On 2/5/15, 6:38 AM

Solved by myself by adding a definition of the LANG variable to the init script:

case "${1}" in
        start)
                echo -n "Starting ${DESC}: "

                LANG="it_IT.UTF-8" start-stop-daemon --start --quiet --pidfile ${PIDFILE} \     ##!! Here I define a utf-8 locale
                        --chuid ${USER} --background --make-pidfile \
                        --exec ${DAEMON} -- ${DAEMON_OPTS}

                echo "${NAME}."
                ;;

 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 2/4/15, 11:04 AM
Seen: 486 times
Last updated: 3/16/15, 8:10 AM