Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2025-05-23
02:20 • Closed ticket [c776eb586d]: "encoding user": wrong answer with UTF-8 s... artifact: 65784ec273 user: apnadkarni
02:18
Fix [c776eb586d]. Read codepage from registry (reported by Jan) check-in: 77971ca3f2 user: apnadkarni tags: tip-716
2025-05-21
13:57 • Ticket [c776eb586d] "encoding user": wrong answer with UTF-8 setting i... artifact: 38c6413096 user: apnadkarni
10:01 • New ticket [c776eb586d]. artifact: 732b3d8ea2 user: jan.nijtmans

"encoding user": wrong answer with UTF-8 setting in manifest

Closed / Fixedc776eb586d08c2f74ea462946b187e12ac182f0aCreated 2 years agoUpdated 2 years ago
Descriptionwiki2025-05-21 10:01:32
Just like [8ffd8cabd1], we expect all Tcl commands to give the same answer, whether the UTF-8 setting is available in the manifest or not.

Let's see if TIP #716 adhers to that:

>.\tclsh90
% tcl::build-info
9.0.2+af16c07b81655fabde8028374161ad54b84ef9956843c63f49976b4ef601b611.gcc-1002
% encoding user
cp1252
% exit

>.\wish90 % tcl::build-info 9.0.2+af16c07b81655fabde8028374161ad54b84ef9956843c63f49976b4ef601b611.gcc-1002 % encoding user utf-8 % exit

We expect the same answer (cp1252) in both cases. If tcl90.dll is embedded in R, the same will happen in that environment (using wish90 here is just for demo purposes).

Note that wish90 has the UTF-8 setting in the manifest, tclsh90 has not (it's the TIP #716 implementation). The tcl dll (tcl90.dll) is the same in both cases.

TIP #718 doesn't have this problem, because it reads value from the registry directly in stead of depending on the getACP() function (which is the cause of the problem here).

Referenced by1
apnadkarniplain2025-05-21 13:57:17
Good point. Agree that looking up the registry is the preferred method.
apnadkarniplain2025-05-23 02:20:31
Fixed in [77971ca3f2]. Note by design, registry is read only once for consistency with Windows where code page does not change in a running process even if registry changes.
Log in (anonymous is fine) to add a comment.