MyBB Community Forums
Error newthread, is it a language prob? - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: Error newthread, is it a language prob? (/thread-175770.html)



Error newthread, is it a language prob? - BaggerHD - 2015-08-23

Got an error :
Type: 2
File: newreply.php (Line no. 712)
Message
json_encode(): Invalid UTF-8 sequence in argument

Can this have something to do with language pack?

Line 712 in newreply.php is:
echo json_encode(array("data" => $data));

newreply.lang.php is:
<?php
/**
 * MyBB 1.8 Norsk (bokmål) språkpakke
 * 
 *
 */

$l['nav_newreply'] = "Post svar";

$l['post_reply_to'] = "Post svar til {1}";
$l['post_new_reply'] = "Post et Nytt Svar";
$l['reply_to'] = "Svar på tråd: {1}";
$l['post_subject'] = "Post emne:";
$l['your_message'] = "Din melding:";
$l['post_options'] = "Innleggsvalg:";
$l['options_sig'] = "<strong>Signatur:</strong> inkluder signaturen din. (bare for registrerte brukere)";
$l['options_emailnotify'] = "<strong>E-postvarsling:</strong> Motta en e-post når et nytt svar blir postet. (bare for registrerte brukere9";
$l['options_disablesmilies'] = "<strong>Skru av smilefjes:</strong> ikke vis smilefjes i dette innlegget.";
$l['post_reply'] = "Post svar";
$l['preview_post'] = "Forhåndsvis innlegg";
$l['mod_options'] = "Moderatorvalg:";
$l['close_thread'] = "<strong>Steng tråd</strong>: forhindre at flere innlegg blir postet i denne tråden.";
$l['stick_thread'] = "<strong>Klistre tråd:</strong> klistre denne tråden til toppen av forumet.";
$l['forum_rules'] = "{1} - Regler";
$l['thread_review'] = "Trådvisning (Nyeste Først)";
$l['thread_review_more'] = "Denne tråden har mer enn {1} innlegg. <a href=\"{2}\">Les hele tråden.</a>";
$l['posted_by'] = "Postet av";
$l['draft_saved'] = "Det nye innlegget blei lagra som en kladd<br />Du vil nå bli sendt til kladdelista din.";
$l['error_post_already_submitted'] = "Du har allerede postet dette svaret i den valgte tråden. Vennligst besøk tråden for å se svaret ditt.";
$l['multiquote_external_one'] = "Du har valgt ett innlegg utenfor denne tråden.";
$l['multiquote_external'] = "Du har valgt {1} innlegg utenfor denne tråden.";
$l['multiquote_external_one_deselect'] = "fjern markering av dette innlegget";
$l['multiquote_external_deselect'] = "fjern markering av disse innleggene";
$l['multiquote_external_one_quote'] = "Siter dette innlegget også";
$l['multiquote_external_quote'] = "Siter disse innleggene også";

$l['redirect_newreply'] = "Takk, svaret ditt blei posta.";
$l['redirect_newreply_moderation'] = "Administratoren har satt det slik at alle nye innlegg krever moderering. Du vil nå bli returnert til tråden.";
$l['redirect_newreply_post'] = "<br />Du vil nå bli sendt til innlegget ditt.";
$l['redirect_newreplyerror'] = "Beklager, men innlegget ditt blei ikke postet siden det mangla innhold. <br />Du vil nå bli sendt tilbake til tråden.";
$l['redirect_threadclosed'] = "Du kan ikke poste innlegg i denne tråden fordi den har blitt stengt av en moderator.";
$l['error_post_noperms'] = "Du har ikke tilgang til å endre denne kladden.";


$l['error_stop_forum_spam_spammer'] = 'Beklager, brukernavn eller IP adresse er det samme som fra en spammer, føler du dette er feil, vennligst ta kontakt med administrator';
$l['error_stop_forum_spam_fetching'] = 'Beklager, det oppstod en feil. Sannsynlig kunne vi ikke få kontakt med spam database. Vennligst prøv på nytt senere.';

$l['error_suspendedposting'] = "Du er fratatt rettigheter til å poste {1}.<br /><br />

Suspension Date: {2}";
$l['error_suspendedposting_temporal'] = "til {1}";
$l['error_suspendedposting_permanent'] = "alltid";



RE: Error newthread, is it a language prob? - Ad Bakker - 2015-08-23

I don't see why the error is caused by a language file. The error is caused by $data, which contains a whole message with a script added to it.

When you think it is caused by a character like å, you should replace these by the unicode equivalent (&aring; ).


EDIT
The ø character can become &oslash;


RE: Error newthread, is it a language prob? - BaggerHD - 2015-08-23

Did update my language pack to 1.8.5 yesterday.... and this is the pack other ppl who want to use norwegian can use (still have some prob uploading it to mybb, but that is another prob)

Letters like æøå are much used in Scandinavian languages, and I did not have this prob with my first version (I made that for 1.8), and if I recall it right, there where more or less no changes in newreply.lang.php from 1.8-1.8.5.

The result from this error where a double reply ........

Have also found this in the footer,,,, (Current time) then in Norwegian
N�v�rende tid

Have given the language pack to another, and his footer give: Nåværende tid (like it should)

Can this have something to do with the prob,,,'? Guess that then it have nothing to do with language pack, but with smt else

(hoop je kan helpen Ad,,,, ja, ja, die praat ook nederlands he he)


RE: Error newthread, is it a language prob? - Ad Bakker - 2015-08-23

(2015-08-23, 06:39 PM)BaggerHD Wrote: (hoop je kan helpen Ad,,,, ja, ja, die praat ook nederlands he he)

One thing for sure, your Dutch is better than my Norwegian.

A more complete list is:

æ  -> &aelig;

ø   -> &oslash;

å   -> &aring;

Æ  -> &AElig;

Ø   -> &Oslash;

Å   -> &Aring;

I have no idea, look in the language file what the translation is in "$lang->welcome_current_time" (global.lang.php). Change it to:

N&aring;v&aelig;rende tid

and see the effect.


RE: Error newthread, is it a language prob? - BaggerHD - 2015-08-23

That did helpSmile ,,, I did give a copy of my language pack to another norwegian,,, and he have not that issue....

I do now see that I have the same issue at other places on the forum as well,,,,,, and strange,,, the other who use my language pack does not.... like the button Go (Gå) is G?

ps woont in middelburgSmile


RE: Error newthread, is it a language prob? - Ad Bakker - 2015-08-23

(2015-08-23, 07:08 PM)BaggerHD Wrote: ps woont in middelburgSmile

Leuke stad!!

I think it is also dependent on how browswers handle these kind of characters. Using the unicode equivalents is save and should work always.