# Error with language manager (Bug report)

**URL:** <https://community.open-emr.org/t/error-with-language-manager-bug-report/18442>\
**Category:** Management and Administration\
**Tags:** bug\
**Created:** [May 7, 2022, 2:03pm UTC](https://community.open-emr.org/t/error-with-language-manager-bug-report/18442 "2022-05-07T14:03:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mlobo4370](https://community.open-emr.org/letter_avatar_proxy/v4/letter/m/a88e4f/32.png) [@mlobo4370](https://community.open-emr.org/u/mlobo4370)\
**Post date:** [May 7, 2022, 2:03pm UTC](https://community.open-emr.org/t/error-with-language-manager-bug-report/18442/1 "2022-05-07T14:03:46Z")

</div>

Hi everyone. I have found an error that maybe @stephenwaite @luisuriarte @sjpadgett and @brady.miller can solve.  
After upgrading to 6.1 (1) I wanted to use the language manager and got the following error (I have the interface in Spanish(Latin America)):

## Query Error

ERROR: query failed: SELECT lc.cons\_id, lc.constant\_name, ld.def\_id, ld.definition, ld.lang\_id FROM lang\_definitions AS ld RIGHT JOIN ( lang\_constants AS lc, lang\_languages AS ll ) ON ( lc.cons\_id = ld.cons\_id AND ll.lang\_id = ld.lang\_id ) WHERE lc.constant\_name COLLATE utf8mb4\_general\_ci LIKE ? AND ( ll.lang\_id = 1 OR ll.lang\_id=? ) ORDER BY lc.constant\_name, BINARY lc.constant\_name, ld.lang\_id COLLATE utf8mb4\_general\_ci

Error: COLLATION ‘utf8mb4\_general\_ci’ is not valid for CHARACTER SET ‘latin1’

/var/www/localhost/htdocs/openemr/interface/language/lang\_definition.php at 216:sqlStatement  
/var/www/localhost/htdocs/openemr/interface/language/language.php at 96:require\_once(/var/www/localhost/htdocs/openemr/interface/language/lang\_definition.php)

This has happened to me in 2 installations with xampp (PHP 7.4) in Win 10.  
The same error i got in the following official demo:  
[https://demo.openemr.io/openemr/interface/main/tabs/main.php?token\_main=QeUmnwOBaDWMYQUsjFB3ZT1mv2IfpXc2dUdsmQw8](https://demo.openemr.io/openemr/interface/main/tabs/main.php?token_main=QeUmnwOBaDWMYQUsjFB3ZT1mv2IfpXc2dUdsmQw8)

For now I have solved it, renaming lang\_definition.php and lenguaje.php and copying instead those of version 6.0.0(4).

thanks for everyone’s effort

---

<div class="post-metadata">

**Author:** ![sjpadgett](https://community.open-emr.org/user_avatar/community.open-emr.org/sjpadgett/32/21623_2.png) [@sjpadgett](https://community.open-emr.org/u/sjpadgett)\
**Post date:** [May 7, 2022, 4:51pm UTC](https://community.open-emr.org/t/error-with-language-manager-bug-report/18442/2 "2022-05-07T16:51:12Z")

</div>

$db\_encoding = ‘utf8mb4’;  
in sites/default/sqlconf.php

---

<div class="post-metadata">

**Author:** ![mlobo4370](https://community.open-emr.org/letter_avatar_proxy/v4/letter/m/a88e4f/32.png) [@mlobo4370](https://community.open-emr.org/u/mlobo4370)\
**Post date:** [May 7, 2022, 4:59pm UTC](https://community.open-emr.org/t/error-with-language-manager-bug-report/18442/3 "2022-05-07T16:59:30Z")

</div>

Thanks sjpadgett. I try it and comment.

---

<div class="post-metadata">

**Author:** ![mlobo4370](https://community.open-emr.org/letter_avatar_proxy/v4/letter/m/a88e4f/32.png) [@mlobo4370](https://community.open-emr.org/u/mlobo4370)\
**Post date:** [May 10, 2022, 9:31pm UTC](https://community.open-emr.org/t/error-with-language-manager-bug-report/18442/4 "2022-05-10T21:31:49Z")

</div>

> [@sjpadgett](#):
>
> $db\_encoding = ‘utf8mb4’;

Hi, Unfortunately it didn’t work, still the same error.

## Query Error

ERROR: query failed: SELECT lc.cons\_id, lc.constant\_name, ld.def\_id, ld.definition, ld.lang\_id FROM lang\_definitions AS ld RIGHT JOIN ( lang\_constants AS lc, lang\_languages AS ll ) ON ( lc.cons\_id = ld.cons\_id AND ll.lang\_id = ld.lang\_id ) WHERE lc.constant\_name COLLATE utf8\_general\_ci LIKE ? AND ( ll.lang\_id = 1 OR ll.lang\_id=? ) ORDER BY lc.constant\_name, BINARY lc.constant\_name, ld.lang\_id COLLATE utf8\_general\_ci

Error: COLLATION ‘utf8\_general\_ci’ is not valid for CHARACTER SET ‘latin1’

C:\xampp\htdocs\HCE\interface\language\lang\_definition.php at 216:sqlStatement  
C:\xampp\htdocs\HCE\interface\language\language.php at 96:require\_once(C:\xampp\htdocs\HCE\interface\language\lang\_definition.php)

---

<div class="post-metadata">

**Author:** ![sjpadgett](https://community.open-emr.org/user_avatar/community.open-emr.org/sjpadgett/32/21623_2.png) [@sjpadgett](https://community.open-emr.org/u/sjpadgett)\
**Post date:** [May 10, 2022, 10:14pm UTC](https://community.open-emr.org/t/error-with-language-manager-bug-report/18442/5 "2022-05-10T22:14:39Z")

</div>

Hi Martin,  
I suppose I could have been more specific. I was trying to point out where you need to handle collation setup and should have gone into more detail.

Since you are not using any flavor of utf8 you should disable the utf8 flag in sqlconf.php e.g:  
`$disable_utf8_flag = true;`  
and completely remove the `$db_encoding = 'utf8mb4';`

For some reason I thought by now everyone could read my mind! Guess not…🙂

---

<div class="post-metadata">

**Author:** ![mlobo4370](https://community.open-emr.org/letter_avatar_proxy/v4/letter/m/a88e4f/32.png) [@mlobo4370](https://community.open-emr.org/u/mlobo4370)\
**Post date:** [March 13, 2024, 6:55am UTC](https://community.open-emr.org/t/error-with-language-manager-bug-report/18442/6 "2024-03-13T06:55:55Z")

</div>

Hi @sjpadgett  
I have updated to version 7.0.2 and I have the same error, deactivating the option in sqlconfig has not solved it, where should I delete the db\_encoding?  
thank you so much

[image]

---

<div class="post-metadata">

**Author:** ![pido](https://community.open-emr.org/user_avatar/community.open-emr.org/pido/32/22483_2.png) [@pido](https://community.open-emr.org/u/pido)\
**Post date:** [April 8, 2024, 9:05pm UTC](https://community.open-emr.org/t/error-with-language-manager-bug-report/18442/7 "2024-04-08T21:05:25Z")

</div>

Hola… Un placer… me sumé hace un par de hora a la comunidad ya que tengo un pequeño cliente … tuve el mismo error y lo solucioné con este foro… en mi caso con la versión 7

> [@Error while editing language definitions](https://community.open-emr.org/t/error-while-editing-language-definitions/18660):
>
> I am trying to edit some language definitions because I use OpenEMR in Spanish. However, any edition causes an error: Query Error Error: COLLATION ‘utf8mb4\_general\_ci’ is not valid for CHARACTER SET ‘latin1’ This error occurs in the official demo at [https://demo.openemr.io/openemr/](https://demo.openemr.io/openemr/) I tried to change the collation in my database, without success. Any clue?
