bugGuile - Bugs: bug #29643, Current locale has higher...

 
 

bug #29643: Current locale has higher precedence than `coding:' when determining file port encoding [1.9.10]

Submitter:  Ludovic Courtès <civodul>
Submitted:  Thu 22 Apr 2010 04:36:39 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  mike121
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 17 Jul 2010 11:25:26 AM UTC, comment #2: 

I pushed a branch that fixed the problem

e50d921bd87e53df33c04831ecf8b3d100af2b7b

Mike Gran <mike121>
Group Member
Sat 05 Jun 2010 09:51:08 PM UTC, comment #1: 

I pushed a new branch to the repo "mike-port-encodings" that may solve the problem.

Consider the top commit
62abf139798af3f35ca3c89200389dc75d51a159

Note that while I was in there, I decided that a similar problem to this bug is that open-file doesn't honor binary-mode it its port encoding, so I added that feature.

Working this revealed unrelated bugs in read-line and scm_i_scan_for_encoding, which are also patched in that branch.

Mike Gran <mike121>
Group Member
Thu 22 Apr 2010 04:36:39 PM UTC, original submission:  

Consider this example:

#v+
scheme@(guile-user)> (setlocale LC_ALL "")
$1 = "LC_CTYPE=en_US.UTF-8;LC_NUMERIC=en_US.UTF-8;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=fr_FR.UTF-8;LC_NAME=en_US.UTF-8;LC_ADDRESS=en_US.UTF-8;LC_TELEPHONE=en_US.UTF-8;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=en_US.UTF-8"
scheme@(guile-user)> (open-input-file "module/scripts/compile.scm")
$2 = #<input: module/scripts/compile.scm 81>
scheme@(guile-user)> (port-encoding $2)
$3 = "UTF-8"
scheme@(guile-user)> (file-encoding $2)
$4 = "ISO-8859-1"
#v-

This file reads "-*- coding: iso-8859-1 -*-" so it should be open using a Latin-1 encoding, regardless of the current locale's encoding.

Ludo'.

Ludovic Courtès <civodul>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mike121 (Updated the item)
  • -email is unavailable- added by civodul (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-07-17 mike121 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2010-06-05 mike121 StatusConfirmed Ready For Test
    2010-06-05 mike121 StatusNone Confirmed
        Assigned toNone mike121

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code