Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
recently (perhaps after upgrade to latest Drupal version, maybe after FileField module update - not sure...), i've started to see this in Drupal's logs:
htmlspecialchars() [function.htmlspecialchars]: Invalid multibyte sequence in argument in /var/www/html/drupal6/includes/bootstrap.inc on line 840.
CentOS release 5.5 (Final)
Drupal 6.17
MySQL 5.0.77
PHP 5.2.10
How to fix it?
Thanx
Comment | File | Size | Author |
---|---|---|---|
#45 | bootstrap.patch | 588 bytes | lordzik |
#42 | bootstrap.patch | 606 bytes | lordzik |
#14 | Coupé.txt | 5 bytes | craig_ |
#14 | file_handle_utf8_filenames.patch | 519 bytes | craig_ |
Comments
Comment #1
lordzik CreditAttribution: lordzik commentedbump
Comment #2
Chi-Yu CreditAttribution: Chi-Yu commentedI encountered the same problem with CCK file upload fields and the problem seems to be related to special characters in filenames. This only seems to happen when the filenames of the images I'm trying to upload contain German Umlauts like in "logo_groß.png".
Comment #3
lordzik CreditAttribution: lordzik commentedLet's try on FileField project...
Comment #4
quicksketchGenerally I'd suggest installing Transliteration to fix problems with URL-unsafe characters. Could you provide steps to reproduce the problem?
Comment #5
quicksketchComment #6
lordzik CreditAttribution: lordzik commentedAttach (using FileField) a file which name is like zażółćgęśląjaźń.pdf and try to browse that node and download this file.
I'll try a module you suggested.
Thnx
Comment #7
quicksketchI can't reproduce this problem in FileField 3.6. I've tried using both private and public files, but they both work fine. I'll need instructions on how to reproduce from a clean Drupal install.
Comment #8
quicksketchYou should also check that you have the multibyte PHP extension enabled on your server, since if you're going to be dealing with UTF-8 characters it's rather important that you have it enabled.
Comment #9
noahterp CreditAttribution: noahterp commentedThis error has occurred for me when the URL alias contained special characters like curly apostrophes (’) or horizontal ellipses (…) -- pathauto doesn't appear to catch those. So in addition to the other suggestions above, just try to stick with regular Latin characters.
Comment #10
lordzik CreditAttribution: lordzik commentedI have php-mbstring installed and properly detected by Drupal.
I still see error in dblog when i view pages where filenames contains polish fonts.
For now, i will attach files again so Transliteration module will replace them.
Regards
Comment #11
Lukas von BlarerThe same error occured when i tried to import exif data from a image which contains umlauts. has anyone fixed this error?
Comment #12
skat CreditAttribution: skat commentedsubcribing
Comment #13
craig_ CreditAttribution: craig_ commentedI was finding the same behavior described, but when using the Drag & Drop upload module. Tracked this down through the layers and found that the problems I was having was the inconsistency of how the file system returns the filename to drupal (non unicode), and how drupal then proceeds to render, expecting unicode.
There are a number of places that call functions for getting file data, but if I patch it at the time it is saved, it clears this message, allows theming, file name display in the form, and file deletion to happen normally again.
Attaching the one-line patch to /includes/file.inc [line: 553]
$file->filename = utf8_encode($file->filename);
And, a sample file for uploading with and without the patch applied.
Comment #14
craig_ CreditAttribution: craig_ commentedattachments
Comment #15
quicksketchThis seems like it's a fix that may be necessary only on certain configurations. Trying out the attached file, I had no problems with uploading or deleting the file on my machine. I'm also not real sure that using utf8_encode() is the right fix, or that we're doing that in the right place.
Comment #16
jan_v CreditAttribution: jan_v commentedHow come this wasn't an issue in previous versions ? What has changed?
Comment #17
jan_v CreditAttribution: jan_v commentedThe utf8_filenames patch of #14 did not work for me.
Adding $text = utf8_encode($text); in bootstrap.inc on line 840 (before the return value) did get rid of the errors, but it replaces the special characters that cause the error in the first place by binary gibberish.
So i think the string with special characters needs to be handled somewhere else.
Comment #18
ikeigenwijs CreditAttribution: ikeigenwijs commentedsubscribe
Comment #19
ikeigenwijs CreditAttribution: ikeigenwijs commentedpatch did not work for me.
kind regards
Comment #20
Mike at techtir CreditAttribution: Mike at techtir commentedI see this recently also (many times last night from 95.31.15.58
log:
Also if I click on http://www.techtir.ie/admin/reports/search_engine_referers I get the errors
Then it does show the usual sort of list:
etc...
Comment #21
downunder_al CreditAttribution: downunder_al commentedI got the same issue with Drupal 6.17 on my live box running:
5.2.10-2ubuntu6.4
Apache/2.2.14 (Ubuntu)
MySQL 5.1.41
I applied the patch ( $text = utf8_encode($text); at line 840, as per #17) and the error went away, but I also got binary gibberish instead of punctuation.
When I upgraded to 6.19, the error returned again (only at bootstrap.inc line 857).
(FWIW I notice that the bootstrap.inc in 6.19 is different to 6.17. Perhaps someone has had a try at fixing this?)
However, when I ran the same build on my dev setup - Windows XP - testing on both PHP 5.2.9-2 and PHP 5.2.10, Apache 2.2.11, MySQL 5.1.36 I do NOT get the error, and it generally works fine, which leads me to suspect that the problem might be to do with different implementations of PHP?
Interestingly, if you google "invalid multibyte sequence in argument in bootstrap.inc on line 857" you get lots of sites showing up with this error.
Currently I have hidden the error message from non-logged-in people, on the grounds that I'd rather have my authorised users ask me about the message than have stupid binary gibberish on the screen.
I'm not sure if it is to do with filefield - surely bootstrap.inc must be part of the core? (forgive my ignorance if I'm wrong - I'm not a php developer, so I haven't looked all that much into this at a code level)
I have upgraded this to major because there seems to be a lot of sites with the same problem.
Again, I wonder if this is to do with a conflict between PHP implementations?
Comment #22
openmode CreditAttribution: openmode commentedI got a similar issue with Drupal 6.19:
Server web Apache
PHP 5.2.11
MySQL 5.0.88
HTML Purifier Library 4.1.1
Libreria Unicode Estensione Mbstring per PHP
The error is in page Site building - Blocks after upgrade from Drupal 6.17:
warning: htmlspecialchars() [function.htmlspecialchars]: Invalid multibyte sequence in argument in /var/www/html/..../includes/bootstrap.inc on line 857.
Comment #23
tengokuhi... i have this error and googling around found this issue
https://drupal.org/node/894880
hope that helps.
suscribing also ;)
Comment #24
downunder_al CreditAttribution: downunder_al commentedI wonder if it is to do with different operating systems? My windows box works fine, my ubuntu live server doesn't.
For the time being I have hidden the error messages away in the logs so at least it doesn't alarm people.
@tengoku I saw that as well, but it doesn't seem to have a solution in the bug (unless I am going blind, which is always possible...)
Comment #25
mwangi CreditAttribution: mwangi commentedthe error also shows up if you have an apostrophe in your url.
this can be caused by pathauto - check the contents of the fields feeding to the url
Comment #26
Anticosti CreditAttribution: Anticosti commentedFor me the error on line 857 dissapeared after uninstalling the Case Tracker Module (casetracker-6.x-1.0-beta8)
Hope this may help...
Comment #27
pixelpreview@gmail.com CreditAttribution: pixelpreview@gmail.com commentedI don't have tracker module installed
but I have this message too but for me it's the line 840 in drupal 6.18
in the check_plain function
these function doesn't exist in precedent version of drupal 6.17 --> 6.18
I have on my server the PHP Version 5.2.14
Comment #28
vanvemdenGot this error when customizing the user-picture.tpl.php file. Used the following code and the error occurred:
<?php print theme('imagecache', 'profile_mini', $account->picture, $alt, $title, $attributes); ?>
The error was gone when I set empty values for undefined variables:
Hope this helps.
Comment #29
etomilin CreditAttribution: etomilin commentedsubscribing
Comment #30
quicksketchI personally don't think this is an issue with FileField. I'll need information on how to reproduce this issue from a fresh Drupal install, otherwise I'll probably close this issue.
Comment #31
Shane Birley CreditAttribution: Shane Birley commentedI would agree. I have seen this error here and there and the issue seems to revolve around core.
Comment #32
Shane Birley CreditAttribution: Shane Birley commentedActually, let me correct myself here. I just said "core" but what I mean is CCK (which I associate with being a "core" contrib module).
Comment #33
xandeadx CreditAttribution: xandeadx commentedActually
Comment #34
timurek CreditAttribution: timurek commentedSame problem here, using charcters ")" and "(" in file name.
Comment #35
xamount CreditAttribution: xamount commentedI have this same problem and I think it relates to the check_plain and with accents in the URL. Not too sure. Definitely something to do with accents.
I do not have cck enabled.
I have made a replica of my site on a differrent server with the only difference being a new version of php and there error is no longer there.
So I get the error in php version 5.2.10 but I do not get the error in php version 5.3.1
Multibyte Support is enabled on both servers in php.
Comment #36
ChrisLaFrancis CreditAttribution: ChrisLaFrancis commentedSubscribing.
Comment #37
quicksketchAs stated by multiple users (especially the "I do not have cck enabled."), this is not an issue with FileField, please look elsewhere for help on this issue.
Comment #38
darkdimme helped
http://info4admins.com/warning-htmlspecialchars-expects-parameter-1-be-s...
Comment #39
MaxMendez CreditAttribution: MaxMendez commentedalso solved my problem
Comment #40
openmode CreditAttribution: openmode commentedSolution posted by darkdim for me don't fix the problem with Drupal 6.22:
PHP 5.2.11
MySQL 5.0.88
The error is in administration page "Site building - Blocks" (other languages ex:it):
warning: htmlspecialchars() [function.htmlspecialchars]: Invalid multibyte sequence in argument in /var/www/html/..../includes/bootstrap.inc on line 857.
Comment #41
Heine CreditAttribution: Heine commentedHi,
The warning you get telling you about the invalid byte sequence is just that; an invalid byte sequence was passed to check_plain. The warning itself is not a bug.
The actual problem is that somewhere along the line, a non-utf8 encoded string was used as if it was utf-8 encoded.
This might be because you scrambled your database, because you saved a tpl.php file with the wrong encoding (damn you Eclipse!) or because the filesystem returns a filename in whatever encoding it feels like.
_THIS_ issue is about files.
craig_ and downunder_al : what filesystem do you use?
Comment #42
lordzik CreditAttribution: lordzik commentedI've put this thread back to Drupal core. Not sure if "file system" Component is a right place (correct me if i'm wrong).
(probably) related case:
http://drupal.org/node/1105168
I've just tried the solution from #1 of that case and i've get rid of the warning!
I've check PHP's manual about htmlspecialchars http://php.net/manual/en/function.htmlspecialchars.php and:
"For the purposes of this function, the charsets ISO-8859-1, ISO-8859-15, UTF-8, cp866, cp1251, cp1252, and KOI8-R are effectively equivalent, provided the string itself is valid for the character set, as the characters affected by htmlspecialchars() occupy the same positions in all of these charsets."
If all of this 7 encodings are "effectively equivalent" and by default (if charset is ommited) ISO-8859-1 is used, then perhaps it is best to get rid of manual charset selection?
Comment #43
lordzik CreditAttribution: lordzik commentedComment #45
lordzik CreditAttribution: lordzik commentedComment #47
Heine CreditAttribution: Heine commentedThe patch in #46 would output invalid bytesequences causing XSS issues in IE6.
The warning is a symptom, not a cause. See also #41.
Comment #48
Heine CreditAttribution: Heine commentedLet me highlight the salient part of the quote:
This is why we use the charset parameter, because we do not know.
Comment #49
lordzik CreditAttribution: lordzik commentedWell, i can live with hypothetical XSS issue. In that particular case it's better than complaining users...
I can only hope that someone will dig deeper and solve the problem :)
Comment #50
Heine CreditAttribution: Heine commentedIt is not hypothetical and I cannot live with it :)
See SA-2008-006 - Drupal core - Cross site scripting (UTF8)
Please do not obstruct fixing the _actual_ problem by treating symptoms.
Please provide steps to reproduce and information on the filesystem in use.
Comment #51
iamatallone CreditAttribution: iamatallone commentedsubscribe
Comment #52
DTB CreditAttribution: DTB commentedThe past have met with this error, but never found the cause of failure ...
Now, I sat down, and step by step tracing the code, but this did not lead solution. I tried to dump out the last of the values of variables .. and got the bug (in my code) A possible source of error, if the UTF8 encoded text using their own code, and you know get a cut of the word-length, such as 255 and to the substr() function is used instead of the mb_substr. This is BIG ERROR, because it may have to halve the two-byte characters for the function, and is a known fault.
SOLUTION: Always use the mb_substr() function!
Comment #53
Heine CreditAttribution: Heine commentedComment #54
timurek CreditAttribution: timurek commentedHi,
my findings are completely different. I use Views for export products from my shop. The View uses "remove HTML tags" for product description (and it is necessary). When there is an HTML entity used in product description (i.e. & nbsp ; or any other entity) then there is empty string returned by view, or - worst case - i got error 500.
backtrace follows:
Backtrace:
htmlspecialchars(array)[bootstrap.inc:856];
.check_plain(array)[views_views_xml_style.theme.inc:40];
..template_preprocess_views_views_xml_style_raw(array)[?:?];
...call_user_func_array(array)[theme.inc:709];
....theme(array)[views_plugin_style_xml.inc:177];
.....views_plugin_style_xml->render(array)[theme.inc:46];
......template_preprocess_views_view(array)[?:?];
.......call_user_func_array(array)[theme.inc:709];
........theme(array)[views_plugin_display.inc:1825];
.........views_plugin_display->render(a:0:{})[view.inc:861];
..........view->render(a:0:{})[views_plugin_display_page.inc:185];
...........views_plugin_display_page->execute(a:0:{})[view.inc:922];
............view->execute_display(a:2:{i:0;s:6:"page_1";i:1;a:0:{}})[views.module:295];
.............views_page(a:2:{i:0;s:22:"xml_view_hledejceny_cz";i:1;s:6:"page_1";})[?:?];
..............call_user_func_array(a:2:{i:0;s:10:"views_page";i:1;a:2:{i:0;s:22:"xml_view_hledejceny_cz";i:1;s:6:"page_1";}})[menu.inc:349];
...............menu_execute_active_handler(a:0:{})[index.php:17];
................index.php
Does anyone have any idea?
Thanks
Comment #55
gandhiano CreditAttribution: gandhiano commentedComment #41 - the issue is related with the files themselves, helped me in fixing this error, which appeared while editing a theme file (fourseasons template.php) using the Theme Editor module.
After converting the file to utf-8, the error was gone and the file was editable. Maybe this helps other people too, although I doubt it's the solution for all the problems reported within this issue.
Comment #56
owice CreditAttribution: owice commentedHi all,
Good work and think from all ..... hats down for your efforts.
I think that the problem is "operating system" related problem because of the following:
I have a website for my department and there is many sections here and I need to upload many files for each one. So I use CCK with filefield using "attach file" method. When I started uploading files, files names in the list was written as question marks (instead of each letter there was a question mark) in the "list" of files - who is using Attach file method will understand me!- so I started to try solving this problem. Because my website is over network, I went to the server and edit the "regional settings" for the system och I forget to tell you that my language is Arabic so the files was Arabic named. So after changing the regional settings on the server a more strange problem appeared ... the files names disappeared. They are listed without name !!!!. I stopped there and think again how to solve the problem. I went to my pc and change the regional setting also. Just after that I faced the problem ... I meant the warning appeared.
Am I say something must not to say? I am sorry before anyone blame me ;)
Also subscribe :)
Comment #57
owice CreditAttribution: owice commentedI forget to tell you the following points:
1) My warning is at different line
------------------------------------------------------------------------------------------
warning: htmlspecialchars() [function.htmlspecialchars]: Invalid multibyte sequence in argument in E:\wamp\www\includes\bootstrap.inc on line 856.
warning: htmlspecialchars() [function.htmlspecialchars]: Invalid multibyte sequence in argument in E:\wamp\www\includes\bootstrap.inc on line 856.
warning: htmlspecialchars() [function.htmlspecialchars]: Invalid multibyte sequence in argument in E:\wamp\www\includes\bootstrap.inc on line 856.
warning: htmlspecialchars() [function.htmlspecialchars]: Invalid multibyte sequence in argument in E:\wamp\www\includes\bootstrap.inc on line 856.
------------------------------------------------------------------------------------------
2) I am using:
Drupal 6.22
CCk 6.x-2.9
Filefield 6.x-3.1
3) Run on Server with Windows Server 2008 64-bit as operating system and (Wamp server 2.1) running with the following properties :
------------------
php 5.3.4
mysql 5.1.53
Apache 2.2.17
------------------
4) The warning just appears at uploading page.
Comment #58
owice CreditAttribution: owice commentedNow I returned regional settings as it was before and the warning disappeared, but the files names returned to be question marks "?????". So I think the problem is with operating system.
I am wondering if there is somebody tell me how windows pass files names to drupal ... I think if we figure this out it may help a lot :)
Hope to read something new soon :)
Smiling is my weapon ... please don't interfere :D :D :P
Thanks for reading
Comment #59
owice CreditAttribution: owice commentedwhen I uploaded a file with question mark name "?????.dwg" the following error happened and the file wasn't uploaded:
-----------------------------------------------------------------------------------------
warning: rename(sites/default/files/projects_related_files_temp/????.dwg,sites/default/files/projects_related_files_temp/????.dwg) [function.rename]: No error in E:\wamp\www\modules\filefield_sources\sources\attach.inc on line 213.
warning: filesize() [function.filesize]: stat failed for sites/default/files/projects_related_files_temp/????.dwg in E:\wamp\www\modules\filefield\field_file.inc on line 155.
The selected file could not be copied, because no file by that name exists. Please check that you supplied the correct filename.
-----------------------------------------------------------------------------------------
Comment #60
interestingaftermath CreditAttribution: interestingaftermath commentedsubscribe
Comment #61
centas CreditAttribution: centas commentedEncountered same issue.
Using: Core 6.19
my issue was that I have had some weird characters in a country list in my own module, and it was causing the problem. Changed them to english letter substitutes.
Comment #62
Heine CreditAttribution: Heine commented#61 is not the same issue; This is about filenames, not improper encodings in other systems. To solve your issue: save the module file as UTF-8.
Comment #63
PepeMty CreditAttribution: PepeMty commentedsubscribing:
Today, after updating Print (with it's library TCPDF) and Conditional Fields I'm having four warnings, on a different line:
warning: htmlspecialchars() [function.htmlspecialchars]: Invalid multibyte sequence in argument in /home/.../xxx.com/includes/bootstrap.inc on line 856.
Only after updating something. I still have more testing to do.
Any ideas?
Comment #64
Andrew Schulman CreditAttribution: Andrew Schulman commentedUgh, subscribing. Could someone please provide a summary for this issue? More than a year later, have we even determined yet what the cause of this problem is? Thanks, Andrew.
Comment #65
Heine CreditAttribution: Heine commentedSee #13 and #41
Comment #66
wolf29 CreditAttribution: wolf29 commentedMy error is showing up at line 856, and when I attempt the fix to suppress the error message my site is just a white screen.
I am using the Atrium profile and the site is utterly fresh, on postgresql database.
The errors were present before I started activating modules. It appears to be still present in core
Atrium1.0
Drupal 6.22
PostgreSQL-9.0
Ubuntu 10.04
Comment #67
Floop CreditAttribution: Floop commentedIf it appears when searching, take a look at #987472: search.module doesn't consistently support multibyte characters . The problem is caused by the search module. Fixing the search module fixed the error for me.
By the way the error can be also suppressed with PHP settings instead of touching the core.
Comment #68
Heine CreditAttribution: Heine commentedThis issue is about charset-problems handling files, not search.
Comment #69
Heine CreditAttribution: Heine commentedretitling.
Comment #70
bserem CreditAttribution: bserem commentedI'm subscribing and keeping an eye to it.
A site that just got into my hands shows this in the watchdog:
http://example/%CE%B5%CE%BB%CE%BB%CE%AC%CE%B4%CE%B1/%C2%AB%CE%B1%CF%85%CE%B8%CE%B1%CE%B9%CF%81%CE%B5%CF%83%CE%AF%CE%B1%C2%BB-%CE%BA%CE%B1%CF%84%CE%B1%CE%B3%CE%B3%CE%AD%CE%BB%CE%BB%CE%B5%CE%B9-%CE%BF-%CF%83%CF%85%CE%BD-%CE%B3%CE%B9%CE%B1-%CF%80%CF%81%CE%BF%CF%83%CE%B1%CE%E5%D5?page=1236
Warning: htmlspecialchars() [<a href='function.htmlspecialchars'>function.htmlspecialchars</a>]: Invalid multibyte sequence in argument in check_plain() (line 1152 of /home/example/public_html/includes/bootstrap.inc).
My problem has to do with urls. I transliterated all files on the system. But the information/patches that come up from this thread might also sove the problem with the urls.
I am thinking of transliterating urls, but the client might disagree...
Comment #71
NancyDruI got this during a 6.22 to 7.9 upgrade. The offending "file" appears to be a new, disabled module that I had in my D7 sites/all/modules folder. This file had a .info file with
Apparently French users are going to have a serious problem updating to 7.9. I changed "é" to "e" and the update proceeded just fine.
Comment #72
mama21mama CreditAttribution: mama21mama commentedThis same error is happening me to me.
htmlspecialchars(): Invalid multibyte sequence in argument en /media/Disco160/www/blog.mamalibre.com.ar/includes/bootstrap.inc en la línea 856.
Comment #73
openmode CreditAttribution: openmode commentedwarning: htmlspecialchars(): Invalid multibyte sequence in argument in /var/www/html/drupal/includes/bootstrap.inc on line 856.
Page Block admin - language italian
PHP Version 5.3.3-7
Drupal 6.22
Comment #74
andyboutte CreditAttribution: andyboutte commentedsubscribe
Comment #75
NancyDruStop subscribing, start following
Comment #76
flefle CreditAttribution: flefle commentedI can confirm that the patch which is removing the " , 'UTF-8' " at line 856 && 858 solved my problem with
" htmlspecialchars() [function.htmlspecialchars]: Invalid multibyte sequence in argument in /var/www/professional.cotyprestige.de/htdocs/includes/bootstrap.inc in Zeile 856. "
Comment #77
maksim24 CreditAttribution: maksim24 commentedi applied the patch which is removing the " , 'UTF-8' " at line 856 && 858 and i am waiting the result
Comment #78
goose2000 CreditAttribution: goose2000 commentedSubscribing, have this issue with D6.24 recent logs are :
cron 02/15/2012 - 11:00pm Cron run completed. Anonymous
php 02/15/2012 - 10:44pm htmlspecialchars() [ page not found 02/15/2012 - 10:44pm bhrplms/theme/moodalis_tango/pix/i/cross_red_small.gif hstrickland
php 02/15/2012 - 10:33pm htmlspecialchars() [ php 02/15/2012 - 10:33pm htmlspecialchars() [ page not found 02/15/2012 - 10:33pm bhrplms/theme/moodalis_tango/pix/i/cross_red_big.gif hstrickland
page not found 02/15/2012 - 10:33pm bhrplms/theme/moodalis_tango/pix/i/cross_red_small.gif hstrickland
page not found 02/15/2012 - 10:31pm taxonomy/term/32 Anonymous
php 02/15/2012 - 10:20pm htmlspecialchars() [ php 02/15/2012 - 10:20pm htmlspecialchars() [ php 02/15/2012 - 10:20pm htmlspecialchars() [ php 02/15/2012 - 10:19pm htmlspecialchars() [ php 02/15/2012 - 10:19pm htmlspecialchars() [ php 02/15/2012 - 10:19pm htmlspecialchars() [ php 02/15/2012 - 10:19pm htmlspecialchars() [ php 02/15/2012 - 10:19pm htmlspecialchars() [ php 02/15/2012 - 10:19pm htmlspecialchars() [ php 02/15/2012 - 10:19pm htmlspecialchars() [ php 02/15/2012 - 10:19pm htmlspecialchars() [ php 02/15/2012 - 10:18pm htmlspecialchars() [ php 02/15/2012 - 10:17pm htmlspecialchars() [ user 02/15/2012 - 10:12pm Session opened for hstrickland. hstrickland
Comment #79
mattyoung CreditAttribution: mattyoung commentedThe exact error message I got is:
warning: htmlspecialchars() [function.htmlspecialchars]: Invalid multibyte sequence in argument in /var/www/html/drupal-6.24/includes/bootstrap.inc on line 860.
Enter here so search can find this issue.
Comment #80
fugazi CreditAttribution: fugazi commentedsame problem as in #79
Comment #81
cilefen CreditAttribution: cilefen commentedsame problem as in #79
Drupal 6.24
PHP 5.3.3
Apache/2.2.15
CentOS 6.2
Comment #82
rogeriodec CreditAttribution: rogeriodec commentedI was having this same problem #79 with Node Import module and solved by doing the following:
That's all.
Comment #83
cweagansSupport requests are never major or critical.
Comment #84
SiteFish CreditAttribution: SiteFish commentedI just experienced the same problem with a page on my site. I tracked it down to a block view where I display the most recent posts with a link to the post. In this view, node titles are output as links using the link path and the alt text from the two preceding hidden attributes [path] and [teaser]. The hidden teaser attribute is trimmed to a maximum of 400 characters on word boundary and HTML tags are stripped. This had always worked fine in the past.
However, after upgrading the site yesterday, I got the warning:
htmlspecialchars() [function.htmlspecialchars]: Invalid multibyte sequence in argument in ... bootstrap.inc on line 860
After some initital search I concluded that the warning occurred whenever the teaser contained a character coded as a named entity, e.g.
ä
for ä. Since ckeditor replaces special characters with named entities, this could very well happen quite frequently, especially for non-English users.Removing the alt text from the view solved the problem. However, as I wanted to keep the alt texts, I instead decided to replace all named entities with special characters not using ckeditor. This also solved the problem for me.
Here is a summary of my relevant updates:
Drupal core from 6.16 to 6.25,
views from 6.x-2.11 to 6.x-2.16 and
ckeditor from 6.x-1.1 to 6.x-1.11
I hope this information will help to shed som light on the underlying cause of the problem.
Comment #85
SiteFish CreditAttribution: SiteFish commentedUnfortunately, this was only a temporary solution. If I write a new post without ckeditor and place a named character in the teaser, the view produces the same warning as before. Alas, I will have to remove the alt texts until there is a fix available.
Comment #86
hedac CreditAttribution: hedac commentedI have this issue too
htmlspecialchars(): Invalid multibyte sequence in argument in .../includes/bootstrap.inc on line 860.
but I don't know why yet.. I don't know how to debug it... but the pages seems to render correctly. I wonder if it is better to ignore it.. but it is a mess in the log.
Comment #87
hedac CreditAttribution: hedac commentedif tried enabling mbstring in php.ini like:
then I don't have more errors in the log... but on drupal status page it says: Error
Multibyte string input conversion in PHP is active and must be disabled. Check the php.ini mbstring.http_input setting. Please refer to the PHP mbstring documentation for more information.
Finally.. the patch at #45 works.
Comment #88
beto_beto CreditAttribution: beto_beto commentedI have this issue too
warning: htmlspecialchars(): Invalid multibyte sequence in argument in C:\inetpub\vhosts\example.com\httpdocs\includes\bootstrap.inc on line 860.
Any Suggestion !!!
Comment #89
Zorkoff CreditAttribution: Zorkoff commentedIn my case, the special characters were actually invalid. I had imported data from a .csv Excel sheet using node import. The problem was that Excel converted characters like ” (which is a Mac created character, not ", the PC created character) into characters like ヤ. To fix it, I opened the original Excel sheet in OpenOffice Calc and then used it to create my .csv import file. I then updated my data in phpMyAdmin. I also could have used Node Export and Node Import Update in 6 or Feeds in 7. But I did have the original data, before it was corrupted by Excel's conversion. If you are starting with invalid characters, you may have to export your data and do a "find and replace" for each special character before updating the data. Just use OpenOffice Calc to do it because it had no problems correctly interpreting special characters created by Mac or PC. I should have paid closer attention to node import's warning "Non UTF8 files are generally generated by MS Excel if you choose CSV format (which you must avoid!)."
Comment #90
Sepero CreditAttribution: Sepero commentedI also got the same error as #79
htmlspecialchars() [function.htmlspecialchars]: Invalid multibyte sequence in argument in /home/sites/penguintutorials.com/public_html/includes/bootstrap.inc on line 860.
Also this:
User Guest
Location http://www.site.com/user/register
Referrer http://www.site.com/user/register
Perhaps this means that someone is trying to register on my site with a non-UTF8 name or password?
Comment #91
Theodores CreditAttribution: Theodores commentedThis worked for me on PHP 5.3 - simply change #860 of bootstrap.inc to read:
First I tried a custom error handler (to find content that needed editing to UTF-8) and used the 'flog' module to write that to my own log file:
Realising that it was too much hassle to edit the content (and that it was just cut and pasted from Word, therefore mostly harmless) I simply set 'ENT_IGNORE' on htmlspecialchars as outlined above.