bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: different encodings for input and output file names and command line


From: Gavin Smith
Subject: Re: different encodings for input and output file names and command line
Date: Thu, 3 Mar 2022 20:13:30 +0000

On Tue, Mar 01, 2022 at 01:42:50AM +0100, Patrice Dumas wrote:
> I commited an implementation.  The XS parser part is incomplete, I coded
> passing the informations, but not using the information, for instance in
> encode_file_name().  Also encode_file_name() should be used for CPP file
> directive, as I reported in another mail.

It's going to take me some time to understand what these customization
variables are supposed to do, if I'm going to implement this in the XS
code.

Would I be right in saying it is just DOC_ENCODING_FOR_INPUT_FILE_NAME
and LOCALE_INPUT_FILE_NAME_ENCODING that the XS parser needs to use?


Change to Common.pm:

+  'DOC_ENCODING_FOR_INPUT_FILE_NAME' => 1,  # if set, use 
LOCALE_INPUT_FILE_NAME_ENCODING
+                                            # for input file name encoding


Yet the code in encoded_input_file_name seems to do the opposite:

+  if ($self->get_conf('DOC_ENCODING_FOR_INPUT_FILE_NAME')) {
+    my $document_encoding;
+    $document_encoding = $self->{'parser_info'}->{'input_perl_encoding'}
+      if ($self->{'parser_info'}
+        and defined($self->{'parser_info'}->{'input_perl_encoding'}));
+    return Texinfo::Common::encode_file_name($self, $file_name,
+                                             $document_encoding);
+  } else {
+    return Texinfo::Common::encode_file_name($self, $file_name,
+                       $self->get_conf('LOCALE_INPUT_FILE_NAME_ENCODING'));
+  }
+}

I'd have thought that LOCALE_INPUT_FILE_NAME_ENCODING would have something
to do with the locale, but the fact it is a string customization variable
suggests it could be set to anything on the command line.  Is that right?

I saw it was set in texi2any.pl from the locale.  Is it possible to set
it from the command line too?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]