Regional setting scrambles non ASCII characters
Posted by: panos78 (---.static.otenet.gr)
Date: July 18, 2022 12:56PM

Hallo.
Today I found a small bug.
Windows 10 has an option, called: "Beta: Use Unicode UTF-8 for worldwide language support" in:
Control Panel -> Region ->Adminisration -> Change system locale
When the user activates this Beta option in Windows 10, the non-latin characters in WAMP are scrambled ( it shows just question marks).
:-)

Dr.nat.techn. Forester-Environmentalist



Edited 1 time(s). Last edit at 07/19/2022 09:48AM by panos78.

Options: ReplyQuote
Re: Regional setting scrambles non latin characters
Posted by: Otomatic (Moderator)
Date: July 18, 2022 03:04PM

Hi,

> called: "Beta: Use Unicode UTF-8
It is "beta" !

Wampmanager language files (wamp(64)/lang/) are encoded according to the "charset" (WindowsCodePage) of the used Windows version, which can be different in different countries.
It can be: 1250 to 1258.

No language file is encoded utf-8, except, of course, the language files used by WEB pages, like index.php (Wampserver home page) or add_vhost.php.

I will - eventually - look when the "beta" option is enabled if the returned WindowsCodePage is utf-8 to see if a transcoding of the Windows-125x language file to utf-8 might work.

Note : Your tittle "Regional setting scrambles non latin characters" should be "Regional setting scrambles non ASCII characters"

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.9 32 bit - Apache 2.4.54 - PHP 8.1.8…5.6.40 - MySQL 5.7.39 - MariaDB 10.5.13/10.6.5
Wampserver 3.2.9 64 bit - Apache 2.4.54 - PHP 8.1.8…5.6.40 - MySQL 5.7.39/8.0.30 - MariaDB 10.5.15/10.7.3
PhPMyadmin 5.1.3 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »



Edited 1 time(s). Last edit at 07/18/2022 03:06PM by Otomatic.

Options: ReplyQuote
Re: Regional setting scrambles non ASCII characters
Posted by: panos78 (---.static.otenet.gr)
Date: July 19, 2022 09:46AM

Understood!
:-)

Dr.nat.techn. Forester-Environmentalist

Options: ReplyQuote
Re: Regional setting scrambles non ASCII characters
Posted by: Otomatic (Moderator)
Date: July 25, 2022 06:19PM

Hi,

It should work with the 3.2.10 update!

Maybe not for all languages because I can only test on a French Windows France, so with the concerned language files encoded Windows-1252.

You could - and when I write "you", it's for all Wampserver users out of Windows-1252 code page - put the script below in wamp(64)/www/ under the name "test_encoding.php" and launch it by 'http:/localhost/test_encoding.php' and put the results here by specifying the country and the language.
<?php

$Text_Encoding = array(
	'IsSingleByte' => '',
	'BodyName' => '',
	'EncodingName' => '',
	'HeaderName' => '',
	'WebName' => '',
	'WindowsCodePage' => '',
	'CodePage' => '',
);
$command = 'CMD /D /C powershell [System.Text.Encoding]:: Default';
$output = `$command`;
foreach($Text_Encoding as $key => $value) {
	if(preg_match('~^'.$key.'\s+:\s+([a-zA-Z0-9\-\'\.\(\) ]+)~mi',$output,$matches) === 1) {
		$Text_Encoding[$key] = $matches[1];
	}
}
$Text_Encoding['LocaleCtype']= trim(strstr(setlocale(LC_CTYPE,''),'.'),'.');
$string = '';
foreach($Text_Encoding as $key => $value) {
	$string .= str_pad($key,17).': '.$value.'<br>';
}
$string = str_replace(' ','&nbsp;',$string);
echo '<pre>'.$string.'</pre>';

?>
For French - France, the results are:
- Windows 10 French France
- Result with Beta utf8 not checked
IsSingleByte     : True
BodyName         : iso-8859-1
EncodingName     : Europe de l'Ouest (Windows)
HeaderName       : Windows-1252
WebName          : Windows-1252
WindowsCodePage  : 1252
CodePage         : 1252
LocaleCtype      : 1252

- Result with Beta utf8 checked
IsSingleByte     : False
BodyName         : utf-8
EncodingName     : Unicode (UTF-8)
HeaderName       : utf-8
WebName          : utf-8
WindowsCodePage  : 1200
CodePage         : 65001
LocaleCtype      : utf8

Thanks.

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.9 32 bit - Apache 2.4.54 - PHP 8.1.8…5.6.40 - MySQL 5.7.39 - MariaDB 10.5.13/10.6.5
Wampserver 3.2.9 64 bit - Apache 2.4.54 - PHP 8.1.8…5.6.40 - MySQL 5.7.39/8.0.30 - MariaDB 10.5.15/10.7.3
PhPMyadmin 5.1.3 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: Regional setting scrambles non ASCII characters
Posted by: panos78 (---.home.otenet.gr)
Date: July 29, 2022 06:51PM

IsSingleByte : True
BodyName : iso-8859-7
EncodingName :
HeaderName : windows-1253
WebName : windows-1253
WindowsCodePage : 1253
CodePage : 1253
LocaleCtype : 1253

IsSingleByte : False
BodyName : utf-8
EncodingName : Unicode (UTF-8)
HeaderName : utf-8
WebName : utf-8
WindowsCodePage : 1200
CodePage : 65001
LocaleCtype : utf8

Dr.nat.techn. Forester-Environmentalist

Options: ReplyQuote


Sorry, only registered users may post in this forum.