Re: [Vim-latex-devel] Re: encoding woes
Brought to you by:
srinathava,
tmaas
From: Benji F. <be...@me...> - 2002-12-21 15:00:39
|
Luc Hermitte wrote: * On Fri, Dec 20, 2002 at 10:04:43AM -0500, Benji Fisher=20 <be...@me...> wrote: I would like to start work on solving the encoding problems. I=20 think we have to consider all combinations of 1. 'enc' is latin1 or utf-8 2. 'fenc' is empty or latin1 or utf-8 3. the text or the "input" place holders or the "output" place holders=20 are outside the 7-bit ASCII range (i.e., they are "funky," to use the=20 technical term ;). What are the situations where real problems exist? This is the question I would like answered for now. What=20 situations are actually broken in the current version? Can we have any certitude about the encoding used by the script file ? So far, we write our scripts in latin1. But if for one reason or another the end user changes something in a script and its encoding on the way, can we be sure iconv(...'latin1') will still work ? (Same issue with nr2char() & co) If we stick to non-funky characters in our script files, I do not=20 think this is an issue. One part of the solution is to avoid using funky characters in script files. I can't agree more. I'm slowy rewriting my scripts to fix this issue. So, now, when I need the markers for instance, I use the function: "Marker_Txt(the_comment)" The only remaining problem, AFAIK, is that funky characters do not match themselves in some contexts. I think I can get around this using iconv() as discussed below. If possible, I'd rather not having to care of the enconding within the jumpings function, but when we set the buffer-variables only. I am not sure this is possible. What if the encoding is changed=20 on the fly? [snip] I prefer iconv() (now you've shown me this function) for converting strings. Let's suppose the end user wishes to use "=AB=A1" and "!=BB" in utf-8. iconv() in that case is easier to use. But, this seems to suppose that the file where the opening and closing strings are defined is in latin1. Does having this script file in utf-8 changes anything ? [snip] No, I have tested it where 'enc' is utf-8 and 'fenc' is either=20 empty or also utf-8, as well as other situations. It looks like a bug=20 to me, but :let foo =3D "\xab" seems to assign the latin1 value of "\xab" (if that is the right way to=20 say it) to foo, instead of using the current encoding. At any rate, it=20 is reasonable that the encoding of the script file, or current buffer,=20 does not affect this. --Benji |