hi,
we are trying to import addresses from a tab-delimited file. The addresses in the file are in local languages such as German or Japanese, which contain special characters. Though ofbiz supports multiple languages, i am not sure how to import them into the database. I will appreciate if anyone can help. Thanks, Rohit |
like ofbiz has escape of html, I suggest you have an escape method for
each language. if you key it off the Locale then it will import based on the language selected for the sight. Or make sure your DB can accept Unicode (16 bit) rohit sent the following on 11/25/2011 4:55 AM: > hi, > > we are trying to import addresses from a tab-delimited file. The addresses > in the file are in local languages such as German or Japanese, which contain > special characters. > > Though ofbiz supports multiple languages, i am not sure how to import them > into the database. > > I will appreciate if anyone can help. > > Thanks, > > Rohit > > > ----- > saanjhi.com > -- > View this message in context: http://ofbiz.135035.n4.nabble.com/Import-addresses-with-special-characters-tp4107252p4107252.html > Sent from the OFBiz - User mailing list archive at Nabble.com. > |
In reply to this post by rohit
Your database must already be set to UTF-8.
If you are using postgres, you can test this by: postgres=# \c ofbiz; psql (8.4.7) You are now connected to database "ofbiz". ofbiz=# \l List of databases Name | Owner | Encoding | Collation | Ctype | Access privileges -------------+----------+----------+-------------+-------------+----------------------- ofbiz | ofbiz | UTF8 | en_US.UTF-8 | en_US.UTF-8 | If you are using mysql, and can test this by: mysql> SHOW CREATE DATABASE ofbiz; +----------+------------------------------------------------------------------+ | Database | Create Database | +----------+------------------------------------------------------------------+ | ofbiz | CREATE DATABASE `ofbiz` /*!40100 DEFAULT CHARACTER SET utf8 */ | +----------+------------------------------------------------------------------+ Also, check a REAL table as well, like this: mysql> SHOW CREATE TABLE ZIP_SALES_RULE_LOOKUP; And look for "DEFAULT CHARSET=utf8" However, I bet it ISN'T because the default that ofbiz sets in framework/entity/config/entityengine.xml for mysql is: character-set="latin1" collate="latin1_general_cs"> And to support UTF8 the mysql section needs to be set to: character-set="utf8" collate="utf8_general_ci" jdbc-uri="jdbc:mysql://127.0.0.1/ofbiz?autoReconnect=true;characterEncoding=UTF-8" If you are already using this mysql DB for production, this could be VERY tricky. Basically, you have to convert the database to utf8, which isn't easy and has risk. Backups are critical. Here is a good reference: http://en.gentoo-wiki.com/wiki/TIP_Convert_latin1_to_UTF-8_in_MySQL After conversion change framework/entity/config/entityengine.xml and test things. Also, don't forget your terminal needs also to be set to UTF8. I use putty, and this is set under: Window -> Translation -> UTF-8 Try first on a test system [grin]. Proceed with caution please. On Fri, Nov 25, 2011 at 4:55 AM, rohit <[hidden email]> wrote: > hi, > > we are trying to import addresses from a tab-delimited file. The addresses > in the file are in local languages such as German or Japanese, which contain > special characters. > > Though ofbiz supports multiple languages, i am not sure how to import them > into the database. > > I will appreciate if anyone can help. > > Thanks, > > Rohit > > > ----- > saanjhi.com > -- > View this message in context: http://ofbiz.135035.n4.nabble.com/Import-addresses-with-special-characters-tp4107252p4107252.html > Sent from the OFBiz - User mailing list archive at Nabble.com. > |
http://www.postgresql.org/docs/8.2/static/multibyte.html
Mike sent the following on 11/25/2011 10:09 AM: > Your database must already be set to UTF-8. > > If you are using postgres, you can test this by: > > postgres=# \c ofbiz; > psql (8.4.7) > You are now connected to database "ofbiz". > ofbiz=# \l > List of databases > Name | Owner | Encoding | Collation | Ctype | > Access privileges > -------------+----------+----------+-------------+-------------+----------------------- > ofbiz | ofbiz | UTF8 | en_US.UTF-8 | en_US.UTF-8 | > > If you are using mysql, and can test this by: > > mysql> SHOW CREATE DATABASE ofbiz; > +----------+------------------------------------------------------------------+ > | Database | Create Database | > +----------+------------------------------------------------------------------+ > | ofbiz | CREATE DATABASE `ofbiz` /*!40100 DEFAULT CHARACTER SET utf8 */ | > +----------+------------------------------------------------------------------+ > > Also, check a REAL table as well, like this: > > mysql> SHOW CREATE TABLE ZIP_SALES_RULE_LOOKUP; > > And look for "DEFAULT CHARSET=utf8" > > However, I bet it ISN'T because the default that ofbiz sets in > framework/entity/config/entityengine.xml for mysql is: > character-set="latin1" > collate="latin1_general_cs"> > > And to support UTF8 the mysql section needs to be set to: > character-set="utf8" > collate="utf8_general_ci" > jdbc-uri="jdbc:mysql://127.0.0.1/ofbiz?autoReconnect=true;characterEncoding=UTF-8" > > If you are already using this mysql DB for production, this could be > VERY tricky. Basically, you have to convert the database to utf8, > which isn't easy and has risk. Backups are critical. > > Here is a good reference: > > http://en.gentoo-wiki.com/wiki/TIP_Convert_latin1_to_UTF-8_in_MySQL > > After conversion change framework/entity/config/entityengine.xml and > test things. > > Also, don't forget your terminal needs also to be set to UTF8. I use > putty, and this is set under: > > Window -> Translation -> UTF-8 > > Try first on a test system [grin]. Proceed with caution please. > > > On Fri, Nov 25, 2011 at 4:55 AM, rohit <[hidden email]> wrote: >> hi, >> >> we are trying to import addresses from a tab-delimited file. The addresses >> in the file are in local languages such as German or Japanese, which contain >> special characters. >> >> Though ofbiz supports multiple languages, i am not sure how to import them >> into the database. >> >> I will appreciate if anyone can help. >> >> Thanks, >> >> Rohit >> >> >> ----- >> saanjhi.com >> -- >> View this message in context: http://ofbiz.135035.n4.nabble.com/Import-addresses-with-special-characters-tp4107252p4107252.html >> Sent from the OFBiz - User mailing list archive at Nabble.com. >> > |
Free forum by Nabble | Edit this page |