[tex-live] cyrillic vs urls

mario chiari ml at mariochiari.net
Wed Jul 27 17:35:01 CEST 2016


On Mon, 2016-07-18 at 15:59 +0200, Zdenek Wagner wrote:
> It does not work this way, URL must be URL-encoded, see e.g. urlencode
> function from PHP:
> http://php.net/manual/en/function.urlencode.php
> 
> So the answer is, you must express it with human unreadable form
> containing % and hexadecima numbers. Modenr browsers often display it
> URL-decoded in the URL bar, but if you copy&paste it to a text editor,
> you can see the URL-encoded form.
> 
> 
> Zdeněk Wagner
> http://ttsm.icpf.cas.cz/team/wagner.shtml
> http://icebearsoft.euweb.cz
> 

Yes, Thanks!
(and indeed if I cut&paste a URL from Firefox, I get the encoded string for
free, nice!)


Consider the following (and see my MWE below)

{\breakhref{https://ru.wikipedia.org/wiki/%D0%9C%D0%B0%D0%BD%D1%83%D0%B8%D0%BB%D
1%8C%D1%81%D0%BA%D0%B8%D0%B9,_%D0%94%D0%BC%D0%B8%D1%82%D1%80%D0%B8%D0%B9_%D0%97%
D0%B0%D1%85%D0%B0%D1%80%D0%BE%D0%B2%D0%B8%D1%87}{https://ru.wikipedia.org/wiki/}
} 

In the final .pdf output, link  connects to target url fine;  however, I am not
able to display a complete link. Neither with encoded string into the second
argument of \breakhref, neither if I try something like: 


{\breakhref{https://ru.wikipedia.org/wiki/%D0%9C%D0%B0%D0%BD%D1%83%D0%B8%D0%BB%D
1%8C%D1%81%D0%BA%D0%B8%D0%B9,_%D0%94%D0%BC%D0%B8%D1%82%D1%80%D0%B8%D0%B9_%D0%97%
D0%B0%D1%85%D0%B0%D1%80%D0%BE%D0%B2%D0%B8%D1%87}{https://ru.wikipedia.org/wiki/\
textcyrillic{Мануильский,_Дмитрий_Захарович}} 	

latter gives me  a number of errors:
line 109: Package inputenc Error: Unicode char �\@inpenc at undefined@
(U+75B)(inputenc) not set up for use with LaTeX. ...ий, Дмитрий Захарович}}
line 109: Argument of \textcyrillic has an extra }. ...ий, Дмитрий Захарович}}
.....


Thanks for your help
mario


------------- my MWE 

\RequirePackage[hyphens]{url}
\documentclass[titlepage,a4paper,12pt]{article}
\usepackage{etex}

\usepackage[backend=biber,style=philosophy-modern,sorting=nyt]{biblatex}
\usepackage[T2A,T1]{fontenc} 
\usepackage[utf8]{inputenc} 

\usepackage{lmodern}         % Enable Latin Modern fonts
\usepackage[pdftex]{graphicx}

\usepackage[american,russian,italian]{babel}
\usepackage{tipa}
\usepackage[babel,italian=guillemets]{csquotes}

\usepackage[hyphens]{url}
\usepackage[colorlinks=true, citecolor=Blue]{hyperref}


\usepackage{soul}


\makeatletter
\newcommand*{\breakhref}{}
\DeclareRobustCommand*{\breakhref}{%
	\begingroup
	\hyper at normalise\breakhref@
}
\newcommand*{\breakhref@}[2]{%
	\endgroup
	\SOUL at setup
	\def\SOUL at everyspace##1{%
		##1%
		\dimen@=\fontdimen2\font
		\advance\dimen@ by \fontdimen3\font
		\cleaders\hbox to \dimen@{%
			\hss
			\href{#1}{\ \vphantom{#2}}%
			\hss
		}\hskip\dimen@\relax
		\hspace{-\fontdimen3\font
			plus \fontdimen3\font minus \fontdimen3\font}%
	}%
	\def\SOUL at everysyllable{%
		\href{#1}{\the\SOUL at syllable\vphantom{#2}}%
	}%
	\def\SOUL at everyhyphen{%
		\discretionary{-}{}{}%
	}%
	\def\SOUL at everyexhyphen##1{%
		\SOUL at setkern\SOUL at hyphkern
		\href{#1}{##1\vphantom{#2}}%
		\discretionary{}{}{%
			\SOUL at setkern\SOUL at charkern
		}%
	}%
	\SOUL@{#2}%
}

\newcommand\cyrillic{%
	\renewcommand\rmdefault{wncyr}%
	\renewcommand\sfdefault{wncyss}%
	\renewcommand\encodingdefault{T2A}%
	\normalfont
	\selectfont}
\DeclareTextFontCommand{\textcyrillic}{\cyrillic} 
\makeatother
\begin{document}
	
\noindent {\breakhref{https://ru.wikipedia.org/wiki/%D0%9C%D0%B0%D0%BD%D1%83%D0%
B8%D0%BB%D1%8C%D1%81%D0%BA%D0%B8%D0%B9,_%D0%94%D0%BC%D0%B8%D1%82%D1%80%D0%B8%D0%
B9_%D0%97%D0%B0%D1%85%D0%B0%D1%80%D0%BE%D0%B2%D0%B8%D1%87}{https://ru.wikipedia.
org/wiki/}} 
\newline
\textcyrillic{Мануильский, Дмитрий Захарович}	
\end{document}

> 
> 2016-07-18 15:53 GMT+02:00 mario chiari <ml at mariochiari.net>:
> > 
> > Hi
> > 
> > please
> > 
> > http://tex.stackexchange.com/questions/319900/cyrillic-and-urls
> > 
> > http://tex.stackexchange.com/questions/192701/cyrillic-and-breakhref-how-do-
> > i-de
> > fine
> > 
> > for me, it is a old, unresolved issue
> > help is welcome
> > thanks, cheers
> > mario
> > 
> > ps if you know of a apter ml to ask this question, please let me know.


More information about the tex-live mailing list