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"

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons



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.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

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.