Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: retroturk on January 02, 2024, 02:16:00 AM

Title: Undefined array key "charset_detected" - upgrading from 1.1.21 to 2.1.4
Post by: retroturk on January 02, 2024, 02:16:00 AM
I finally decided to upgrade the forum, which was live in SMF 1.1.21, to 2.1.4. For now, I'm doing the conversion locally and actually there was no problem until the 6th step, which is the conversion to UTF-8. But at this point I encountered a problem but I couldn't find the solution...

QuoteWarning
: Undefined array key "charset_detected" in
D:\xampp\htdocs\forum\upgrade.php
on line
3143

When I look at the database, I see that the tables are latin5_turkish_ci. Is latin5_turkish_ci causing problems during conversion? I don't know how to solve it...

Does anyone have any ideas to help with this? thanks.
ps.Actually when i tested the upgraded forum, there is not any problem..

Error line in Upgrade.php  (line 3143)
// Default to ISO-8859-1 unless we detected another supported charset
$upcontext['charset_detected'] = (isset($lang_charsets[$language]) && isset($charsets[strtr(strtolower($upcontext['charset_detected']), array('utf' => 'UTF', 'iso' => 'ISO'))])) ? $lang_charsets[$language] : 'ISO-8859-1';

$upcontext['charset_list'] = array_keys($charsets);
[/quote]
Title: Re: Undefined array key "charset_detected" - upgrading from 1.1.21 to 2.1.4
Post by: Doug Heffernan on January 02, 2024, 06:22:03 AM
Can you start over but set the default language to english this time and see how it will?
Title: Re: Undefined array key "charset_detected" - upgrading from 1.1.21 to 2.1.4
Post by: Kindred on January 02, 2024, 10:46:36 AM
oof......    @Doug Heffernan -- the forum language is not the problem....

The collation of the database being in Turkish --  I think that may be a problem.  Honestly, I am surprised that SMF 1.x worked with that collation.

@Sesquipedalian maybe you can make a suggestion on how the user can convert to utf8mb3_general_ci, since I am reasonably sure that the automated process won't work in this case.

Title: Re: Undefined array key "charset_detected" - upgrading from 1.1.21 to 2.1.4
Post by: Arantor on January 02, 2024, 01:32:10 PM
Latin5 is ISO-8859-5, as in "if you install Turkish not in UTF-8 mode this is what it will install as".
Title: Re: Undefined array key "charset_detected" - upgrading from 1.1.21 to 2.1.4
Post by: Kindred on January 02, 2024, 01:57:17 PM
@Arantor  OH!   Ok...   well, that's interesting (and I didn't know that)

IN that case -- @retroturk try what Doug suggested...   set the forum default language to English before upgrading.

Title: Re: Undefined array key "charset_detected" - upgrading from 1.1.21 to 2.1.4
Post by: retroturk on January 03, 2024, 02:25:14 PM
thanks a lot @Kindred and @Doug Heffernan .

I set the  forum default language to English and upgrade.php completed upgrade tasks...

but, some of the Turkish letters (characters) look wrong.


Tanışma - Tanýþma
Diğer   - Diðer
etc.
Title: Re: Undefined array key "charset_detected" - upgrading from 1.1.21 to 2.1.4
Post by: Steve on January 04, 2024, 08:43:52 AM
You have the latest Turkish language pack and switched the forum back to Turkish, correct?
Title: Re: Undefined array key "charset_detected" - upgrading from 1.1.21 to 2.1.4
Post by: Doug Heffernan on January 04, 2024, 11:16:51 AM
Additionally have a look at th ebelow wiki and make sure that your forum has been converted and configured properly to UTF-8. (It says that's is for Smf 2.0.x but it is valid for Smf 2.1.x as well)

https://wiki.simplemachines.org/smf/UTF-8_Readme