6.0.0-beta1
10/16/25

[#4555] ISO-8859-1 and mySQL issue - stripped characters
Summary ISO-8859-1 and mySQL issue - stripped characters
Queue Horde Framework Packages
Queue Version HEAD
Type Bug
State Not A Bug
Priority 1. Low
Owners
Requester thomas (at) conzignus (dot) se
Created 10/24/2006 (6932 days ago)
Due
Updated 10/26/2006 (6930 days ago)
Assigned 10/24/2006 (6932 days ago)
Resolved 10/26/2006 (6930 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
10/26/2006 09:38:51 AM Jan Schneider Comment #9
State ⇒ Not A Bug
Reply to this comment
And I tried echoing out the query, which gave me the insert query
with the values replaced by question marks (this was from the
Kronolith). The values array did include the correct letters (with
åäö).
OK, so the error is outside of Horde.
However, I didn't find the query method from $this->_db. Now I think
I did though, it uses the PHP built in DB-handler (DB.php and
DB/mysql.php in my case in the PHP share directory), or, no?
Not built in PHP, but provided by the PEAR DB package. You can 
retrieve the actual query sent to the DB server with 
$this->_db->last_query *after* the $this->_db->query() call.
Anyway, this is really confusing...
Now I tried to insert an event and to my surprise it worked with
these letters... And I hadn't changed anything. The only thing that
had changed, that I know of, was my browser session but should that
matter? Is the server settings somehow stored in my session?
Yes.
10/26/2006 09:25:44 AM thomas (at) conzignus (dot) se Comment #8 Reply to this comment
I tried to trace the query and I found this:

---

// Execute the query.

$result = $this->_db->query($query, $values);

---

And I tried echoing out the query, which gave me the insert query with 
the values replaced by question marks (this was from the Kronolith). 
The values array did include the correct letters (with åäö).

However, I didn't find the query method from $this->_db. Now I think I 
did though, it uses the PHP built in DB-handler (DB.php and 
DB/mysql.php in my case in the PHP share directory), or, no?



Anyway, this is really confusing...

Now I tried to insert an event and to my surprise it worked with these 
letters... And I hadn't changed anything. The only thing that had 
changed, that I know of, was my browser session but should that 
matter? Is the server settings somehow stored in my session?
10/26/2006 08:22:13 AM Jan Schneider Comment #7 Reply to this comment
I haven't found where the function $this->_db->query is executed in
the libraries so I haven't seen the SQL query yet. That might help
since what goes in that function seem to be correct.
You already know how the method is called, but didn't find where? I 
don't follow.
10/26/2006 07:38:15 AM thomas (at) conzignus (dot) se Comment #6 Reply to this comment
Sorry. Function is print_r of course, I did that on both the $_POST 
and $values arrays.
10/26/2006 07:36:34 AM thomas (at) conzignus (dot) se Comment #5 Reply to this comment
Stipping is done before writing to the DB - the DB field only contains 
the "Sm" in "Smörgåsbord".



I've tried making a print_f($_POST) when this occur and the result is 
correct, although it is UTF8 encoded in IE, FireFox displays it 
correctly.

When converted in the $values array this it is correct in both browsers.



I haven't found where the function $this->_db->query is executed in 
the libraries so I haven't seen the SQL query yet. That might help 
since what goes in that function seem to be correct.
Looks good. When is the stripping happening? While writing to the DB
or reading from it, i.e. is the data stored correctly in the database?
10/25/2006 11:22:12 AM Jan Schneider Comment #4 Reply to this comment
Looks good. When is the stripping happening? While writing to the DB 
or reading from it, i.e. is the data stored correctly in the database?
10/24/2006 04:50:22 PM thomas (at) conzignus (dot) se Comment #3 Reply to this comment
Yes, I read about that in the Horde FAQ. They are installed. Although, 
I couldn't figure out if I needed to change any settings on them. This 
is a excerp from phpinfo():



[code]iconv support         enabled

iconv implementation         glibc

iconv library version         2.4



Directive        Local Value        Master Value

iconv.input_encoding        ISO-8859-1        ISO-8859-1

iconv.internal_encoding        ISO-8859-1        ISO-8859-1

iconv.output_encoding        ISO-8859-1        ISO-8859-1[/code]





Multibyte Support         enabled

Multibyte string engine         libmbfl

Multibyte (japanese) regex support         enabled

Multibyte regex (oniguruma) version         3.7.1



mbstring extension makes use of "streamable kanji code filter and 
converter", which is distributed under the GNU Lesser General Public 
License version 2.1.



Directive        Local Value        Master Value

mbstring.detect_order        no value        no value

mbstring.encoding_translation        Off        Off

mbstring.func_overload        0        0

mbstring.http_input        pass        pass

mbstring.http_output        pass        pass

mbstring.internal_encoding        no value        no value

mbstring.language        neutral        neutral

mbstring.strict_detection        Off        Off

mbstring.substitute_character        no value        no value
10/24/2006 03:59:42 PM Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
Do you have the mbstring and iconv extensions installed?
10/24/2006 02:39:23 PM thomas (at) conzignus (dot) se Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ ISO-8859-1 and mySQL issue - stripped characters
Queue ⇒ Horde Framework Packages
State ⇒ Unconfirmed
Reply to this comment
I'm not sure this is a bug but I have a troublesome problem with the 
charset in Horde when it comes to database queries - the rest works 
fine.



I've installed Horde with IMP, Turba, Passwd,Kronolith and Nag and I'm 
using a MySQL 5.0 database server. Other system specifications are 
Gentoo Linux 2.6.16, Apache 2.0, PHP 5.



Problem is that whenever some information including Swedish letters å, 
ä or ö should be inserted in a table (like in Turba, Kronolith and 
Nag) not only this special character is removed - ALL the text after 
the character is too. So, if I add a task called "Smörgåsbord" the Nag 
will show me this below the name column: "Sm".



I've upgraded to the last Gentoo stable version of the Horde framework 
which is: 3.1.3. I've went through forums, search engines and I've 
never seen someone have the exact same problem (however charset 
problems are somewhat common everywhere).



PHP default_charset is iso-8859-1, MySQL database charset is 
iso-8859-1 and Horde SQL charset is iso-8859-1.



If help is available I'd be very thankful!

/Thoas


Saved Queries