Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Arabic characters gives ASCII code 63

Dear all,
I have imported some Arabic text into excel. When I convert them to
ASCII, I get the value 63 for all characters. What happened? Do I need
to install any language packs?

Regards,
Julian

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Arabic characters gives ASCII code 63

You shouldn't need a Arabic language pack to *handle* Arabic in my
experience - you do if you want to read it and have the glyphs behave
correctly .

How did you import them? A text file? Was it unicode? Or single byte
(ISO-8859-6 maybe)?

Gareth

wrote:
Dear all,
I have imported some Arabic text into excel. When I convert them to
ASCII, I get the value 63 for all characters. What happened? Do I need
to install any language packs?

Regards,
Julian

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Arabic characters gives ASCII code 63

Hi,
I imported via XML files. I don't know what a unicode or single byte is
:(
Can you help?

Regards,
Julian


Gareth wrote:
You shouldn't need a Arabic language pack to *handle* Arabic in my
experience - you do if you want to read it and have the glyphs behave
correctly .

How did you import them? A text file? Was it unicode? Or single byte
(ISO-8859-6 maybe)?

Gareth

wrote:
Dear all,
I have imported some Arabic text into excel. When I convert them to
ASCII, I get the value 63 for all characters. What happened? Do I need
to install any language packs?

Regards,
Julian


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Arabic characters gives ASCII code 63

I just found out. I think it's using xml version="1.0" encoding="utf-8"
Hope this info helps.

Regards,
Julian

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Arabic characters gives ASCII code 63

Hi Julian

I've never used utf-8 I'm afraid. UTF-8 is a single byte character set
but... it used 2 bytes when handling Arabic AFAIK. Excel supports
standard unicode UTF-16.

from http://czyborra.com/utf/#UTF-8
<<UTF-8 consumes two bytes for all non-Latin (Greek, Cyrillic, Arabic,
etc.) letters that have traditionally been stored in one byte and three
bytes for all symbols, syllabics and ideographs that have traditionally
only needed a double byte. This can be considered a waste of space and
bandwidth which is even tripled when the 8bit form is MIME-encoded as
quoted-printable ("=C3=A4" is 6 bytes for the one character ä). SCSU
aims to solve the compression problem.

Sounds a bit strange to me but it makes sense to use 2 bytes - you just
can't get all of the Arabic char set easily into 1 byte. ISO-8859-6
tries but misses out some less commonly used letters/glyphs.

You get char 63 - which in hex is 3F - I suspect this might be the
leading byte in a two byte character.

My questions:

(a) Where is the file from / how is it created?

(b) Are you sure the Arabic is in there correctly in the first place?
(Try opening it up in IE to check or even in notepad.)

If you find it *is* in there correctly feel free to send me a copy of
the file and I'll take a look at it. Send it to the name excelvba with a
domain name of garhoo and put a com at the end of it.

HTH,
Gareth



wrote:
I just found out. I think it's using xml version="1.0" encoding="utf-8"
Hope this info helps.

Regards,
Julian



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Arabic characters gives ASCII code 63

Hi Gareth,
I mailed you the file. But if you didnt receive it please email me at
or and I will resend the file to you.

Thank you for your time.

regards,
julian

Gareth wrote:
Hi Julian

I've never used utf-8 I'm afraid. UTF-8 is a single byte character set
but... it used 2 bytes when handling Arabic AFAIK. Excel supports
standard unicode UTF-16.

from
http://czyborra.com/utf/#UTF-8
<<UTF-8 consumes two bytes for all non-Latin (Greek, Cyrillic, Arabic,
etc.) letters that have traditionally been stored in one byte and three
bytes for all symbols, syllabics and ideographs that have traditionally
only needed a double byte. This can be considered a waste of space and
bandwidth which is even tripled when the 8bit form is MIME-encoded as
quoted-printable ("=C3=A4" is 6 bytes for the one character ä). SCSU
aims to solve the compression problem.

Sounds a bit strange to me but it makes sense to use 2 bytes - you just
can't get all of the Arabic char set easily into 1 byte. ISO-8859-6
tries but misses out some less commonly used letters/glyphs.

You get char 63 - which in hex is 3F - I suspect this might be the
leading byte in a two byte character.

My questions:

(a) Where is the file from / how is it created?

(b) Are you sure the Arabic is in there correctly in the first place?
(Try opening it up in IE to check or even in notepad.)

If you find it *is* in there correctly feel free to send me a copy of
the file and I'll take a look at it. Send it to the name excelvba with a
domain name of garhoo and put a com at the end of it.

HTH,
Gareth



wrote:
I just found out. I think it's using xml version="1.0" encoding="utf-8"
Hope this info helps.

Regards,
Julian


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Arabic characters gives ASCII code 63

Hi Julian

I emailed you a response. For the benefit of other NG readers - since I
haven't seen this issue around much and someone else may be interested -
I'll write a note here too.

I see what you're trying to do and your approach makes sense. The only
problem is that you are looking at the ASCII/ANSI values i.e. assuming
that each character is represented as a number between 0 and 255. This
isn't the case, VBA handles the string internally as unicode i.e. two
bytes per character. This is hidden from the developer - the length of a
5 character string is still 5 but it's still 10 bytes.

Thus, all you need to do is get the unicode value for each character
rather than the ANSI number. This is achieved by using AscW in place of
Asc and then writing it back you need to use ChrW rather than Chr.

I've pasted a demo function below to show how Excel handles strings as
unicode - even without having to use StrConv(x, vbunicode) etc.

HTH,
Gareth

Function CopyUnicodeToCellByCharacter(rng As Range) As String
'just an experiment to make sure my methodology works
Dim i As Integer
Dim CellValue As String
Dim NewValue As String
Dim UnicodeChar As Integer

'Get the string from the cell. Although it may not look like it
'this is in fact unicode. It's kinda hidden from you.
CellValue = rng.Value

'go through the string character by character (note that
'each character is 2 bytes - you just don't see it)
For i = 1 To Len(CellValue)
'get the unicode value for this character
UnicodeChar = AscW(Mid$(CellValue, i, 1))
'append this to our string - as unicode
NewValue = NewValue & ChrW(UnicodeChar)
Next i

'Write our string back to the cell.
'Again, this is unicode (no conversion necessary)
CopyUnicodeToCellByCharacter = NewValue

End Function


wrote:
Hi Gareth,
I mailed you the file. But if you didnt receive it please email me at
or and I will resend the file to you.

Thank you for your time.

regards,
julian

Gareth wrote:

Hi Julian

I've never used utf-8 I'm afraid. UTF-8 is a single byte character set
but... it used 2 bytes when handling Arabic AFAIK. Excel supports
standard unicode UTF-16.

from
http://czyborra.com/utf/#UTF-8
<<UTF-8 consumes two bytes for all non-Latin (Greek, Cyrillic, Arabic,
etc.) letters that have traditionally been stored in one byte and three
bytes for all symbols, syllabics and ideographs that have traditionally
only needed a double byte. This can be considered a waste of space and
bandwidth which is even tripled when the 8bit form is MIME-encoded as
quoted-printable ("=C3=A4" is 6 bytes for the one character ä). SCSU
aims to solve the compression problem.

Sounds a bit strange to me but it makes sense to use 2 bytes - you just
can't get all of the Arabic char set easily into 1 byte. ISO-8859-6
tries but misses out some less commonly used letters/glyphs.

You get char 63 - which in hex is 3F - I suspect this might be the
leading byte in a two byte character.

My questions:

(a) Where is the file from / how is it created?

(b) Are you sure the Arabic is in there correctly in the first place?
(Try opening it up in IE to check or even in notepad.)

If you find it *is* in there correctly feel free to send me a copy of
the file and I'll take a look at it. Send it to the name excelvba with a
domain name of garhoo and put a com at the end of it.

HTH,
Gareth



wrote:

I just found out. I think it's using xml version="1.0" encoding="utf-8"
Hope this info helps.

Regards,
Julian



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I handle High Ascii characters in Excel bordahl Excel Discussion (Misc queries) 0 January 28th 08 06:04 PM
Need Excel VBa to display Arabic characters Alseikhan Excel Discussion (Misc queries) 1 May 14th 06 02:42 PM
Replacing ascii characters HappyCamper Excel Worksheet Functions 2 February 8th 06 07:10 PM
characters automatically converted to arabic fonts masoud Excel Discussion (Misc queries) 1 December 15th 05 10:28 AM
math powers, fractions and editing ASCII characters matt dunbar Excel Programming 1 December 31st 03 01:38 PM


All times are GMT +1. The time now is 05:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"