Uploaded image for project: 'AdMaxLocal'
  1. AdMaxLocal
  2. AML-1166

Hitting MySQL results in mojibake

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.1.0
    • Component/s: None
    • Labels:
    • Environment:

      Dev Tomcat (tsa-chef-qa1) against Dev MySQL (tsa-aq-mysql1)

    • Sprint:
      Sprint 5 - Cumberland, Sprint 6 - Cumberland

      Description

      I found this by running the UserServiceI18NTests against dev's MySQL db. Foreign characters are stored and retrieved as question marks. I suspect this problem is across the board for all the services/tables.

      Response body after I make a new user:

      2013-02-13 15:50:34,242-2629 [main] DEBUG ResponseMatchers[96] - Parsed JSON to: {"lastName":"????? ?????????????? ? ?????????? ???? ?","birthday":null,"lastLoginDate":"1970-01-01T00:00:00.000+0000","countryCode":"au","workPhoneExtension":null,"properties":

      {"password":"tc8Ej4RJ"}

      ,"homePhone":"","id":"59848d29-42d3-4950-83ad-2bb7bcfda561","timezone":"EST","organization":"tsa","mobilePhone":"","createdBy":"c7542d20-f6ba-4784-842b-9202a92190e2","realm":"com.thesearchagency","email":"i18nJsonTest0@thesearchagency.com","description":"????? ?????????????? ? ?????????? ???? ?","lastModifiedBy":"c7542d20-f6ba-4784-842b-9202a92190e2","gender":"M","lastModifiedDate":"2013-02-13T20:56:52.000+0000","active":true,"language":"en","firstName":"????? ?????????????? ? ?????????? ???? ?","workPhone":"","displayName":"????? ?????????????? ? ?????????? ???? ?","createdDate":"2013-02-13T20:56:52.000+0000"}

      Steps to reproduce:

      Run any of the *I18NTests against a MySQL db.
      Example: mvn test -Dtest=UserI18NTests -DtestServerUrl=http://tsa-chef-qa1:8080/sapi/rest

      Solution?

      • -Change the tables from Latin-1 to UTF-8- They are UTF-8
      • -Check my.cnf-
        character-set-server            = utf8
        default-character-set           = utf8
        character_set_client            = utf8
        collation_server                = utf8_general_ci
        
      • Check the connection settings in sapi-datasouce-configuration.xml
      • Is the Tomcat locale messing with the data? AML-1167 would fix this
      • -Tomcat connector (server.xml)-
            <Connector port="8080" protocol="HTTP/1.1" 
                       connectionTimeout="20000" 
                       URIEncoding="UTF-8"
                       redirectPort="8443" />
        

        p.s. http://www.urbandictionary.com/define.php?term=mojibake

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gavin.nicol Gavin Nicol (Inactive)
                Reporter:
                stacie.waleyko Stacie Waleyko (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: