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]

Submitted by:  Ludovic Courtès <civodul>
Submitted on:  Thu 22 Apr 2010 04:36:39 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Mike Gran <mike121>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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

I pushed a branch that fixed the problem

e50d921bd87e53df33c04831ecf8b3d100af2b7b

Mike Gran <mike121>
Project MemberIn charge of this item.
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>
Project MemberIn charge of this item.
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>
Project Administrator

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 17 Jul 2010 11:25:26 AM UTCmike121StatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Sat 05 Jun 2010 09:51:08 PM UTCmike121StatusConfirmed=>Ready For Test
    Sat 05 Jun 2010 04:29:22 PM UTCmike121StatusNone=>Confirmed
      Assigned toNone=>mike121

    Back to the top


    Powered by Savane 3.1-cleanup1