Special characters bad encoded
-
Categories with special characters like “ñ” or accents (`, ´) are not correctly displayed, for example “Compañía” is shown as “CompañÃa”. Using HTML entities doesn’t help.
How can I have categories with special characters?
Thanks.
-
Hi goraxan,
categories are not the onle issue… problem you talked about exists for file title and link label too!
I’m working on it.
Ok, I did it 🙂
Take a look at WordPress Download Manager Plugin – Fix “bad” characters encoding
Hope it will help 🙂
This is the patch:
File “wpdm-categories.php”
Line 94 – Original Line:
<b><?php echo $pres.' '.stripslashes($category['title'])?></b>
Line 94 – Modified Line:
<b><?php echo $pres.' '.stripslashes($category['title'])?></b> <?php /* by M.C. - Modified - Add stripslashes function before $category['title'] */ ?>Line 102 – Original Line:
<input type="text" style="width: 99%;font-size: 14pt" name="cat[title]" value="<?php echo htmlspecialchars($cat[title]); ?>">
Line 102 – Modified Line:
<input type="text" style="width: 99%;font-size: 14pt" name="cat[title]" value="<?php echo stripslashes(htmlspecialchars($cat[title])); ?>"> <?php /* by M.C. - Modified - Add stripslashes function before htmlspecialchars */ ?>
File “wpdm-list-files.php”
Line 118 – Original Line:
"><?php echo $media['title']?> <input style="text-align:center" type="text" onclick="this.select()" size="20" title="Simply Copy and Paste in post contents" value="[wpdm_file id=<?php echo $media['id'];?>]" />
Line 118 – Modified Line:
"><?php echo stripslashes($media['title'])?> <input style="text-align:center" type="text" onclick="this.select()" size="20" title="Simply Copy and Paste in post contents" value="[wpdm_file id=<?php echo $media['id'];?>]" />
<?php /* by M.C. - Modified - Add stripslashes function before $media['title'] */ ?>
File “wpdm-add-new-file.php”
Line 40 – Original Line:
<td><input style="font-size:16pt;width:100%;color:<?php echo $file['title']?'#000':'#ccc'; ?>" onfocus="if(this.value=='Enter title here') {this.value=''; jQuery(this).css('color','#000'); }" onblur="if(this.value==''||this.value=='Enter title here') {this.value='Enter title here'; jQuery(this).css('color','#ccc');}" type="text" value="<?php echo $file['title']?$file['title']:'Enter title here'; ?>" name="file[title]" /></td>
Line 40 – Modified Line:
<td><input style="font-size:16pt;width:100%;color:<?php echo $file['title']?'#000':'#ccc'; ?>" onfocus="if(this.value=='Enter title here') {this.value=''; jQuery(this).css('color','#000'); }" onblur="if(this.value==''||this.value=='Enter title here') {this.value='Enter title here'; jQuery(this).css('color','#ccc');}" type="text" value="<?php echo $file['title']?stripslashes(htmlspecialchars($file['title'])):'Enter title here'; ?>" name="file[title]" /></td> <?php /* by M.C. - Modified - Add stripslashes and htmlspecialchars functions before $file['title'] */ ?>Line 65 – Original Line:
<td><input size="10" type="text" style="width: 200px" value="<?php echo $file[link_label]?$file[link_label]:'Download'; ?>" name="file[link_label]" />
Line 65 – Modified Line:
<td><input size="10" type="text" style="width: 200px" value="<?php echo $file[link_label]?stripslashes(htmlspecialchars($file[link_label])):'Download'; ?>" name="file[link_label]" /> <?php /* by M.C. - Modified - Add stripslashes and htmlspecialchars functions before $file['link_label'] */ ?>
File “download-manager.php”
Line 257 – Original Line:
echo "<li style='line-height:16px'><input type='checkbox' name='file[category][]' value='$id' $checked />" . $cat[title];
Line 257 – Modified Line:
echo "<li style='line-height:16px'><input type='checkbox' name='file[category][]' value='$id' $checked />" . stripslashes($cat[title]); /* by M.C. - Modified - Add stripslashes function before $cat['title'] */
File “wpdm-server-file-browser.php”
Line 27 – Original Line:
echo "<li class=\"directory collapsed\">" . htmlentities($file) . "";
Line 27 – Modified Line:
echo "<li class=\"directory collapsed\">" . html_entity_decode($file) . ""; /* by M.C. - Modified - changed functions name to html_entity_decode from htmlentities */…that’s all!
In my previous post I included a link that’s point to a post where I explain the patch.
The topic ‘Special characters bad encoded’ is closed to new replies.