view src/po/big5corr.c @ 34698:e5d2d9024ad6 v9.1.0229

patch 9.1.0229: Error E877 is not translated Commit: https://github.com/vim/vim/commit/b64cec217f3434a089a5677d265bfbc21367e98b Author: Christian Brabandt <cb@256bit.org> Date: Sun Mar 31 17:52:56 2024 +0200 patch 9.1.0229: Error E877 is not translated Problem: Error E877 is not translated (RestorerZ) Solution: Declare the error with N_ to mark it as translatable, add _() around the error message in regexp_nfa.c fixes: #14333 Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sun, 31 Mar 2024 18:00:04 +0200
parents 45c0a5330758
children
line wrap: on
line source

/*
 * Simplistic program to correct Big5 inside strings.  When a trail byte is a
 * backslash it needs to be doubled.
 * Public domain.
 */

/*
 * 06.11.23, added by Restorer:
 * For more details, see:
 * https://github.com/vim/vim/pull/3261
 * https://github.com/vim/vim/pull/3476
 * https://github.com/vim/vim/pull/12153
 * (read all comments)
 *
 * I checked the workability on the list of backslash characters
 * specified in zh_TW.UTF-8.po. It works.
 * But it is better to have someone native speaker check it.
 *
 */

#include <stdio.h>
#include <string.h>

	int
main(int argc, char **argv)
{
	char buffer[BUFSIZ];
	char *p;

	while (fgets(buffer, BUFSIZ, stdin) != NULL)
	{
		for (p = buffer; *p != 0; p++)
		{
			if (strncmp(p, "charset=utf-8", 13) == 0
				|| strncmp(p, "charset=UTF-8", 13) == 0)
			{
				fputs("charset=BIG-5", stdout);
				p += 12;
			}
			else if (strncmp(p, "# Original translations", 23) == 0)
			{
				fputs("# Generated from zh_TW.UTF-8.po, DO NOT EDIT.", stdout);
				while (p[1] != '\n')
					++p;
			}
			else
			{
				if (*(unsigned char *)p >= 0xA1)
				{
					putchar(*p++);
					if (*p == '\\')
						putchar(*p);
				}
				putchar(*p);
			}
		}
	}
}