Closed qiancy98 closed 3 years ago
TODO: if the encode
function throws a warning, write it into log.
Finish the TODO now.
Thanks very much for this, I've reviewed it and it looks good!
A minor point: I think that this line can be deleted, as I'd say the default would be not to mention encoding
:
$logger->info("*Encoding of the paths takes the default.");
A bigger question: does this feature need to be applied for other user settings? For example, if I call
latexindent.pl -l=其他网盘.yaml myfile.tex
does the local file 其他网盘.yaml
need encoding?
Final question: am I correct to reference https://metacpan.org/pod/distribution/Encode/lib/Encode/Supported.pod for the supported values for the encoding
field?
Thanks so much for your time on this, I'm really grateful! :)
This looks great to me. I've tested it on my Linux machine, and it doesn't change anything, which is as I would expect. I don't have a direct way of replicating your results, but as this is an optional feature, I'm happy to accept it as is.
I'll get this documented, and credit you in the documentation. It'll be part of the next release.
Thanks so much again!
For my reference, this is about https://github.com/cmhughes/latexindent.pl/issues/263
It seems to be OK. I struggled but failed to compile it, and thus the following codes are not checked by latexmk... Only one question:
If you find that \announce{new}{encoding option for indentconfig.yaml} \texttt{latexindent.pl}
does not read your YAML file, then you might like to explore the \texttt{encoding} option
for \texttt{indentconfig.yaml} as demonstrated in \cref{lst:indentconfig-encoding}.
is it a need for us to mension the reason and a simple solution for Windows users? for example: (Of course you have to change it to meet the rest format of the document...)
If you find that \announce{new}{encoding option for indentconfig.yaml} \texttt{latexindent.pl}
does not read your YAML file, then it might be as a result of the default commandline encoding not being UTF-8
\footnote{Normally this will only occcur for Windows users}.
In this case, you might like to explore the \texttt{encoding} option
for \texttt{indentconfig.yaml} as demonstrated in \cref{lst:indentconfig-encoding}.
For Windows users that meet this question, there is an easy way:
you can run the following command in either
\texttt{cmd.exe} or \texttt{powershell.exe}:
\begin{lstlisting}
chcp
\end{lstlisting}
Assume that you receive the following result
\begin{verbatim}
Active code page: 936
\end{verbatim}
Then you can use
\begin{lstlisting}
encoding: cp936
\end{lstlisting}
in \texttt{indentconfig.yaml}, where 936 is the result of the \texttt{chcp} command.
This should work in most of cases.
That's wonderful, thanks so much! I've implemented your suggestions as of https://github.com/cmhughes/latexindent.pl/commit/4b38910de547a6790baf5b4f0ccbf493ffc7c33f
Thanks so much!
This pull can specify the encoding of the file system. This is my first time writing perl and I was just copying and imitating from the same file. I will appreciate it if you can check my pull (I am hopping that it satisfies the gramma.)
At least it works well. Two logs are shown below with command
perl .\latexindent.pl '.\notes of sparsity.tex' > try.tex
under powershell (sinceindentconfig.yaml
is included in the log I will not put it alone). Their only difference is theencoding
switch ofindentconfig.yaml
.