Anderson Lizardo wrote:
Hi dev's,

FIY, the Subversion commit messages need always to be written either in Unicode or plain ASCII, so "svn log --xml" can output valid XML data. So please, setup your favorite editor to one of these encodings
 before issuing a "svn commit".

A bit wrong. SVN uses the current locale encoding when accepting the log
message from the editor or from the command line, and then internally
converts it to UTF-8. When dumping the log in non-XML format, it is
converted from UTF-8 to the locale encoding. When dumping the log in XML format, it stays in UTF-8.

That said, the commit 6803 on the LFS repository broke the script that generates log messages for the website, because of an non-Unicode char on its commit message. You can reproduce the problem
 with this command:

svn log -r6803 --verbose --xml svn://svn.linuxfromscratch.org/LFS

This means that somebody somehow misconfigured Subversion. BTW my
attempts to reproduce this failure mode in the toy repository failed:

# Attempt to simulate a misconfigured locale
# and pass a string of 8-bit characters

LANG=C svn commit -m "Добавлена пустая строка"
svn: Commit failed (details follow):
svn: Can't recode string

# Attempt to insert an invalid character in UTF-8 string
# the locale is ru_RU.UTF-8, terminal is properly configured

svn commit -m `echo -e "Добавлена \xc0 пустая строка"`
svn: Valid UTF-8 data
(hex:)
followed by invalid UTF-8 sequence
(hex: c0)

I.e., all my attempts to add invalid characters to the log failed. ("Добавлена пустая строка" == "Added an empty line").

Jim: how did you do that? Which svn version?
Anderson: Which svn version is on the server?

Notice that the XML header says the content is in utf-8, but the content itself contains the "ü" char (the ü HTML entity). That confuses the XML::Parser module used on the script. As a workaround, I had to force the script to always interpret its input as ISO-8859-1.

Is this possible to undo the hack now? It would prevent "normal" non-ASCII log messages from working properly.

--
Alexander E. Patrakov
--
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to