1.2.1448. Wrong Locale

This rule checks the locale used in the code, against a library of known valid locales. Unknown locales are reported: they might be typos or unknown to certain systems.

<?php

// what language ?
setLocale(LC_ALL, 'hx');

// utf8 actually needs a - : utf-8
setLocale(LC_ALL, 'utf8');

?>

Name

Default

Type

Description

otherLocales

array

Other accepted locales, comma separated

maxPositions

3

integer

Number of argument in setLocale() to be tried.

1.2.1448.1. Connex PHP features

1.2.1448.1.1. Suggestions

  • Use a valid locale

1.2.1448.1.2. Specs

Short name

Structures/WrongLocale

Rulesets

All, Analyze, Changed Behavior, Semantics

Exakat since

2.4.2

PHP Version

All

Severity

Major

Time To Fix

Quick (30 mins)

Precision

High

Available in

Entreprise Edition, Exakat Cloud