To solve this problem I need to insert this instruction BEFORE iconv
:
setlocale( LC_ALL, "pt_BR.UTF-8");
Thus, the conversion is done correctly (in my case, because my site is in pt_BR
):
<?php
$filename = "ação";
setlocale( LC_ALL, "pt_BR.UTF-8"); // fix the locale
$filename = iconv( 'UTF-8', 'ASCII//TRANSLIT', $filename); // convert latin characters
echo $filename; // shows "acao"
Correct result:
acao
Related Posts:
- How to add elements to an empty array in PHP?
- Can I use the same nonce for multiple requests on the same page?
- WordPress and magic quotes
- Any guides on creating custom admin pages?
- Decrease file size upload in Media
- Customize default settings on new sites on multisite
- wp_delete_auto_drafts() deletes links in menus
- WP E-commerce: Showing 3 random products from current category when viewing product
- If Custom Field is empty don’t display div
- the_author_posts_link css class
- Question about repurposing WordPress 404 handler
- Design view breaking on Pages
- Hooking new functions to actions + passing parameters
- error_log is not working as expected in functions.php file
- WordPress template_include filter not working properly
- query if on page/2/?
- “The plugin generated 2694 characters of unexpected output…” on Plugin activation, CREATE TABLE sql command not working
- How to display a value from a radio button in the options menu in wordpress
- How to debug php code in hostgator cPanel
- WooCommerce: Add Payment Gateway Field to Webhooks [closed]
- Web scraping using transients
- Parsing php string in jquery [closed]
- doing an ajax request always outputs 0
- What is the intended purpose of the _wp_attachment_context post meta key?
- PHP Script for last login time
- Why the JavaScript code is ignored from wp editor?
- Why does my callback function not work with this custom filter hook?
- Get and insert order email address to the PHP template inside HTML text
- Integrating PHP into Javascript to display map markers with Google API – problem with wp_localize
- Send an email to specific adress when button is clicked?
- Unable to write multiple values back to ACF user field – PHP
- PHP Array Returning [object Object]. Tried existing answers results with no luck
- PHP version problem?
- Why Won’t My Inputs in a form with a Get method work together?
- Extend PHP regex to cover “srcset” and “style” attributes
- Sort by page information by Ascending Numbers
- Automatic Shortcode Creation with Custom Fields [closed]
- WordPress function when file is uploaded, deleted or edited
- WordPress wp_redirect error
- single.php error
- Using a $GET parameter from a URL, to redirect to a URL (WordPress)
- wp-options keep crashing please help
- How do I display offsite database info on my wordpress site?
- Post’s ID pattern?
- Countdown to date function?
- Hide Heading if ACF Field is empty
- How to remove the message ‘We could not find any results for your search’ without changing template files and without adding posts/pages?
- calling a custom field value inside functions.php
- User Meta Value not echoing despite Var_Dump Showing correct string
- How to Handle Going Backwards in Navigation When Referrer in PHP/JavaScript won’t work?
- Why does my user not get added to the database on custom registration?
- WordPress check if current taxonomy has child
- Is there a name for trivial WP PHP files like functions.php, archive php entry.php, page.php and so forth?
- show something only when user comes from specific page at remote host?
- Using bloginfo and divs inside a php file
- get_theme_mod outputs number when using WP_Customize_Cropped_Image_Control
- array_rand not working correctly?
- How do I increase the upload size only when editing special pages?
- ‘global’ not working in wordpress?
- Show login greeting above sub-menu links?
- Conditional On custom field plugin metabox
- Which version of PHP-FPM is necessary to work with WP 3.5?
- Exclude function from running on a certain page
- wordpress sql posts query won’t display the latest post in a specific category
- Woocommerce Custom Meta Boxes- How to only display if they actually have content
- How to change image product page by variation in PHP code?
- duplicate posts with ajax load more wordpress
- Fetch Data from an external MSSQL Database in a Managed WP hosting
- How can I show how much water got saved on this order (making use of the number of items bought) on a thank-you-page?
- Posts page (category) layout modification, which php file change?
- How to add WordPress Featured image in tag ..?
- How do I get the value of a current user’s custom field?
- Redirect user to a custom url after logged in
- Adding extra data to shortcode attributes and pass it to JS with wp_localize_script
- The link you followed has expired. Please try again
- Allow Comments by Default for Multiple Post Types
- Related Posts: if there is no category use tags
- Cleaner ‘for each’ loop for registering scripts in functions.php
- HELP! Frontend User Profile Edit Won’t Update Email
- How to get User Avatar Image with link to Author and User name in Html Title tag?
- New database entry to trigger runing PHP/SQL query through link with token, without logging into the website
- How to make a parent page for author.php?
- How to get all users by user_login as a json_encode array?
- defined (‘ABSPATH’) false after AJAX post to other PHP-file
- show desktop version of website if button is submited
- Subheader title depends on post – change to static
- Use jQuery and AJAX to get HTML
- Make the text field in search form optional
- To call hook on a php external file
- Create new folder and upload files to custom folder via wp_handle_upload
- Set active class in a Php foeach
- Loading a post’s content, into a div outside the loop, when it’s title is selected in a list
- Hide the content before the more tag in the “single page”
- Adding a Sub Menu Options Page WP Backend Menu. Whats wrong with my code?
- PHP code for link with text
- how to add display_name
- how to loop through blog posts in php
- Restricting access to a file for everyone except logged in users
- WordPress Block Editor Gutenberg running code inside ! is_admin()
- Tags being Inserted in html from plugin PHP not passing through the_content