Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Encoding problem
colak wrote #315879:
Did you try the htaccess way? you can add
AddDefaultCharset utf-8on the top of the file.
Or is it possible to copy out the BB sql file, edit to add the “ AddDefaultCharset utf-8” in the sql directly. and then re-import that file.
BACKUP everything before trying.
…. texted postive
Offline
#17 2019-01-01 21:39:16
- Rob.
- New Member
- Registered: 2018-12-31
- Posts: 6
Re: Encoding problem
It seems to me that I solved the problem by accident :)
I have found the txplib_db.php in Lib directory and I have tested different settings “utf8_*” in line 223 and 225. Without any success. Then I decided to try to remove this block of code by commenting lines from 217 to 227. I have refreshed the page and now it’s work! I don’t know the explanation but I don’t care – I can continue to work with the blog.
Thank you for your assistance. “Encoding issue” can be mark as SOLVED and CLOSED.
Offline
Re: Encoding problem
Thanks for the report. I’ve never seen this part of the code before, but it looks like it is MySQL 5 specific. In my Diagnostics db version reads as
MySQL: 5.5.5-10.1.37-MariaDB (mariadb.org binary distribution)
which seems to work fine. But in your case it is reported as
MySQL: 10.1.24-MariaDB-cll-lve (MariaDB Server)
so the version is possibly wrongly detected. Needs further testing.
Offline
Re: Encoding problem
Oleg – from memory, I’ve seen MariaDB-cll-lve appear on cPanel servers, if that helps research.
Last edited by gaekwad (2019-01-02 18:36:59)
Offline
#20 2019-01-02 20:13:58
- singaz
- Member
- Registered: 2017-03-12
- Posts: 150
Re: Encoding problem
Addition.
This is not a problem. The site works fine without errors.
But there is one incomprehensible line (see screenshot):

Initially the site worked on version 4.5.7. The site is constantly updated with the release of new versions of the engine (4.6.0, 4.6.1, 4.6.2 ….. 4.7.2)
I do not remember when the string appeared.
Checked base Notepad ++. There are no words in the database /etc pki /tls /certs /tmp /var /usr /local /php55 /lib /php
Where can these records be stored?
Sorry my horror English. I’m learning textpattern, I’m learning English
Offline
Re: Encoding problem
singaz: The open_basedir reference is probably from the PHP 5.* era. Has the server run PHP 5 previously and then been updated to PHP 7?
Last edited by gaekwad (2019-01-03 10:36:19)
Offline
#22 2019-01-03 12:32:33
- singaz
- Member
- Registered: 2017-03-12
- Posts: 150
Re: Encoding problem
Yes.
Previously, the server php5.4 (or 5.5) was run with the version txp4.5.7.
After update textpattern to 4.6.0, has been updated to php5.6.
After update textpattern to 4.7.0, has been updated to php7.
Sorry my horror English. I’m learning textpattern, I’m learning English
Offline
Re: Encoding problem
Did you consider adding
AddHandler application/x-httpd-php72 .php
AddDefaultCharset utf-8
in your htaccess file? It forces the server to use php 7.2.x and UTF-8 Charsets
Last edited by colak (2019-01-03 18:19:38)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#24 2019-01-03 18:14:10
- singaz
- Member
- Registered: 2017-03-12
- Posts: 150
Re: Encoding problem
All changes php did in the panel direct admin

My files .htaccess
# BEGIN Textpattern
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#Options -Indexes
#ErrorDocument 403 default
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /relative/web/path/
RewriteCond %{HTTPS} !=on [OR]
RewriteCond %{HTTP_HOST} ^mydomain.com$ [NC]
RewriteRule ^(.*)$ https://www.mydomain.com/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) - [PT,L]
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*) index.php
RewriteCond %{HTTP:Authorization} !^$
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>
###php_value register_globals 0
<IfModule mod_mime.c>
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
</IfModule>
# END Textpattern
Perhaps, the hosting provider has made changes in inaccessible for me to view
Sorry my horror English. I’m learning textpattern, I’m learning English
Offline
Re: Encoding problem
Can you try adding the two lines I posted above either before # BEGIN Textpattern or after # END Textpattern and report what happens? If you get an error of any sort, all you will need to do is delete those lines.
ps. I edited them to force php 7.2
Last edited by colak (2019-01-03 18:20:11)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Encoding problem
This could be a problem: RewriteCond %{HTTP_HOST} ^mydomain.com$ [NC] RewriteRule ^(.*)$ https://www.mydomain.com/$1 [R=301,L]
Offline
#27 2019-01-03 21:18:12
- singaz
- Member
- Registered: 2017-03-12
- Posts: 150
Re: Encoding problem
I made 2 experiments.
experiment 1:
deleted
RewriteCond %{HTTPS} !=on [OR]
RewriteCond %{HTTP_HOST} ^mydomain.com$ [NC]
RewriteRule ^(.*)$ https://www.mydomain.com/$1 [R=301,L]
and added
AddHandler application/x-httpd-php72 .php
AddDefaultCharset utf-8
before # BEGIN Textpattern
Nothing changed.


experiment 2:
deleted
RewriteCond %{HTTPS} !=on [OR]
RewriteCond %{HTTP_HOST} ^mydomain.com$ [NC]
RewriteRule ^(.*)$ https://www.mydomain.com/$1 [R=301,L]
and added
AddHandler application/x-httpd-php72 .php
AddDefaultCharset utf-8
after # END Textpattern
Nothing changed.

This is probably the specifics of hosting.
Tomorrow I will try a new installation of the new site.
Sorry my horror English. I’m learning textpattern, I’m learning English
Offline
Re: Encoding problem
This bit:
RewriteCond %{HTTPS} !=on [OR]
RewriteCond %{HTTP_HOST} ^mydomain.com$ [NC]
RewriteRule ^(.*)$ https://www.mydomain.com/$1 [R=301,L]
is not relevant for the PHP version. It only has to do with redirecting to a secure connection and you’ll need an SSL certificate (e.g. Let’s Encrypt or a paid one) to avoid the browser trying to block access. The important thing is mydomain.com should be changed to match your own domain – maybe that is what jrmartin was referring to.
The AddHandler method is a way to force php files to handled via a specific version of php that can be different to the one set in your control panel. Setting the PHP version in the control panel or your host’s settings is preferable. You only need the AddHandler method if:
- your host doesn’t allow you to reset your php version on a host’s site (webfaction’s specific app-container setup can make that necessary)
- you want to change the php version for just one folder in your host’s container. For example, you have Textpattern running on php 7+ but need to use an older script in a subdirectory that is only compatible with php 5.6 (or vice versa).
You can put a phpinfo.php file into the respective directory and call it via the browser to display your php version and settings. Remember to remove it again after you’re done.
So, in summary, if all your scripts for that site run with php 7.x, set that in your control panel and you should be fine. I think gaekward’s comment is probably right: the line under open_basedir is probably just a leftover path from when the site was running an earlier version of php.
TXP Builders – finely-crafted code, design and txp
Offline
#29 2019-01-06 22:15:23
- singaz
- Member
- Registered: 2017-03-12
- Posts: 150
Re: Encoding problem
jakob thanks!
Open question for me
I will try and write off later
Sorry my horror English. I’m learning textpattern, I’m learning English
Offline