[XeTeX] graphic filename in Chinese

Jonathan Kew jfkthame at googlemail.com
Fri Apr 24 10:15:49 CEST 2009


On 24 Apr 2009, at 08:21, Akira Kakuto wrote:

>> 2009/4/23 Yue Wang <yuleopen at gmail.com>:
>>> On Windows, I already set the encoding to UTF-8.
>>> The output log is get from TeXWorks. Windows' cmd cannot display  
>>> that
>>> (I am using the English version, but I doubt Chinese version cannot
>>> display that either since Simplified Chinese version Windows use GBK
>>> for cmd).
>
> In my test,
> \XeTeXpicfile "\344\275\240\345\245\275.jpg" \bye
> can include the picture file without any problem
> on windows. See an attached fname.tar.gz.
> (I've written here the name with octal numbers, since
> my mail program does not know utf8 encoding.)
> Note that the file name must also be utf8.


Yes, if the actual filename on your Windows machine is UTF-8, then it  
should work to use

   \XeTeXpicfile "你好.jpg"

(regardless of whether your source document encoding is utf-8 or  
utf-16).... or even

   \XeTeXpicfile "^^^^4f60^^^^597d.jpg"

if you are using an ASCII-only editor!

> The problem is that it is not easy to make a
> file with utf8 name.

How can the user control which encoding Windows uses for filenames? Is  
this related to the current regional/language settings of the system,  
I guess?

In any case, what's really needed is for xetex to become aware of this  
and convert the name appropriately before calling fopen().

JK



More information about the XeTeX mailing list