Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to detect codepage in windows

10 views
Skip to first unread message

kvak

unread,
Sep 1, 2008, 11:47:03 AM9/1/08
to

Hi,
Is there any way to detect windows codepage of a file (which is not unicode)
in windows

Thank you.

Mihai N.

unread,
Sep 2, 2008, 1:58:25 AM9/2/08
to
> Is there any way to detect windows codepage of a file
> (which is not unicode) in windows

Not reliably. And it is not a Windows problem.

You can get a "best guess" using MLang, the IMultiLanguage2 interface,
with DetectCodepageInIStream or DetectInputCodepage
http://msdn.microsoft.com/en-us/library/aa741001(VS.85).aspx

The more text, the more reliable. But still a guess.

--
Mihai Nita [Microsoft MVP, Visual C++]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email

Hosszu Gabor

unread,
Sep 18, 2008, 2:13:45 AM9/18/08
to
Dear Colegues,

I loaded a Word doc to Openoffice write that contains Unicode SMP (plane
1) characters. However, the Openoffice displays duoble-rectangulars, only.

I have Windows XP. I can display the SMP chars by word, however some
features of the Unicode system do not work, e.g. LTO PDf pair.

But the current problem is that the Openoffice writer does not diplay the
SMP chars.

Could you help me?

Best Regards

Gábor

Dr. Gabor Hosszu, Ph.D., Assoc. Prof.
Dept. of Electron Devices, BME
http://nimrud.eet.bme.hu/hosszu

Mihai N.

unread,
Sep 18, 2008, 5:34:09 AM9/18/08
to
> I loaded a Word doc to Openoffice write that contains Unicode SMP (plane
> 1) characters. However, the Openoffice displays duoble-rectangulars, only.
SMP is called BMP (Basic Multilingual Plane, the range from U+0000 to U+FFFF)
Usually rectangles means bad font.


> I have Windows XP. I can display the SMP chars by word, however some
> features of the Unicode system do not work, e.g. LTO PDf pair.

It is most likely that OpenOffice does it's own text layout engine.
Which means the problem is in OpenOffice.

> But the current problem is that the Openoffice writer does not diplay the
> SMP chars.

Try other font?
(one that you are sure it contains the characters you want)

You are basically giving us a puzzle asking us to guess, because
you don't give any kind of info.
Stuff like what version of Open Office you use, what are the characters
with problems, how do they get there (are you sure they are not corrupted),
what font are you using, what kind of language support you have installed
on your XP.

Hosszu Gabor

unread,
Sep 18, 2008, 6:59:50 AM9/18/08
to
Dear Mihai,

My font contains SMP (Supplementary Multilingual Plane), I myself created
them. I located these characters into unallocated place in the SMP. In the
MS Word, all these characters are visible. Under IE they are also visible
perfectly. Naturally for this the font has to be installed.

But under Oo I cannot see the SMP glyphs.

The version of my Oo is: 2.4, Hungarian.

I did not set any special language support in the XP.

If you can, please, help me. If can give any further information, too.

Kind Regards

Mihai N.

unread,
Sep 19, 2008, 12:41:14 AM9/19/08
to
> My font contains SMP (Supplementary Multilingual Plane)
Sorry, my misunderstanding :-)

> The version of my Oo is: 2.4, Hungarian.

Looks like an instance of this bug:
http://www.openoffice.org/issues/show_bug.cgi?id=40391
You might give a try to version 3 (I did not)

Hosszu Gabor

unread,
Sep 24, 2008, 4:57:07 PM9/24/08
to Mihai N.
Dear Mihai,

Thanks. I may try the version 3, however, it is beta yet.

Best Regards

Gábor

Dr. Gabor Hosszu, Ph.D., Assoc. Prof.
Dept. of Electron Devices, BME
http://nimrud.eet.bme.hu/hosszu

0 new messages