texinfo-devel
[Top][All Lists]
Advanced

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

Re: new command @U{nnnn}?


From: Karl Berry
Subject: Re: new command @U{nnnn}?
Date: Sun, 23 Nov 2014 19:16:29 GMT

    Actually, the input encoding and output encoding are already separated.

Sure, in texi2any they are.  I meant at the Texinfo level.  A document
cannot separately specify input and output enc.

    gives a cryptic warning (there is a thread/bug on that in bug-texinfo), 

Yes, I recall.

    I have no idea if it is easy to catch those errors to say something
    more interesting mentionning @documentencoding.

I don't know if it's easy or not either.  I suppose it is possible in
principle, but It's not like we're getting a ton of complaints about it.

    locale at "C", the utf8 encoded file is read correctly).  

I believe it's just reading bytes in that case, and Perl/Unidecode knows
enough to make that work, thankfully.  "C" is my usual environment, so I
would notice right away if it failed.

    implementing @U{NNNN} would be rather trivial even for Plaintext and
    Info if we assume that the user only uses unicode points that perl
    can output in the output encoding (default or set by
    @documentencoding), it would indeed just amount to replacing it by
    "\xNNNN".  

Do you mean the six-character ASCII string \, x, N, N, N, N,
or (I suppose) the result of Perl interpreting its string "\xNNNN"?

I think the two most important cases are (1) ASCII and (2) UTF-8.
For the latter, right, outputting the UTF-8 representation of U+NNNN is
no problem.

For ASCII (when no documentencoding is specified or when it is
US-ASCII), I think it would be better to output the plain ASCII string
U, +, N, N, N, N instead of anything binary.  Same principle as @'e.

    In HTML and XML, to be consistent, one should take into
    account ENABLE_ENCODING_USE_ENTITY to use "&NNNN;" or "\xNNNN".  
    
Sure, good.

    If we want to make sure that the output is correct and perl won't
    output a warning, it may be less easy and I don't even know if it is
    possible.

Agreed, so let's not worry about the warnings and perfect output.

Anyway, I'm not entirely sure how this will work out in TeX.  I'll work
on it a little bit when I have a chance and then get back.

karl



reply via email to

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