Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Maltese Falcon 2

Status
Not open for further replies.

fischadler

Programmer
May 31, 2002
258
0
0
MT
For my home language, Maltese, we use the standard Latin alphabet with the addition of four special characters ?, ?, ? and ?. As far as I know, we're the only country that uses those characters (you're welcome to prove me wrong). However, the folks at Microsoft have been nice enough to include those characters in Word 2000 onwards. I've made special shortcuts so that I can use them in Word. If I copy text from Word and paste it in Notepad, those characters come up properly. If I then copy the text from Notepad and paste it into Frontpage, they also show up properly, but in "code mode" they are shown as Ċ,Ġ,etc.
Before Word 2000 came along, the only way to show those characters was to use special fonts and replace seldomly used characters such as "[" and "{" to print those characters. Up until now there are still people who use those fonts but if I change the font to Arial or Times New Roman, the text does not come up right.
Therefore I tried to create a simple VB application that changes those characters ([, {, ], }) in a string in clipboard to the correct Maltese character. However, I could not paste the correct character inside the VB editor. If I paste "?" it comes as a "G" (which in Maltese has a different pronounciation). I was using the code below:

Code:
strOutput = Replace(strInput, "[", "g")

The "g" should have a dot on it but it doesn't come up in the VB editor.
I also tried this:

Code:
strOutput = Replace(strInput, "[", Chr(288))

but this generated an error 5.

Is there someone out there that knows a way around this?

Thanks!

P.S. The 1941 movie "Maltese Falcon" has nothing to do with Malta!
 
Unfortunately the 4 special characters all showed up as question marks (?) in your post - ain't technology wonderful? However, since you said that pasting into Notepad reproduces the characters correctly, perhaps you could make a text file with just the 4 characters separated by commas. Read the text file into VB and store the characters in variables (string or variant probably). That way the characters never need to be typed in the VB editor. Alternatively, this may also be a way to get the ASCII values for these characters (if there are ASCII values) and be able to reproduce them in your app.

Anyway, I wish I could help more. Let us know how it works out.

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
fischadler -
This is probably a good reason to move to .NET, as it's fully Unicode compliant. VB6 is, sortof, except for the forms engine -- it only knows ANSI (or whatever language the Visual Basic product was localized to for your market).

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Believe it or not, the special characters appeared properly in the preview! But I didn't check how they finally appeared in the posting.

I tried the text file solution and put in the 8 special characters (there's the lowercase too!) but this is what was returned in the clipboard:

ÿþ
  !&'{|

I don't think there are any ASCII values for these characters because I think ASCII only arrives until 255.

Anyway, thank you both for your interest!
 
Sorry for being unclear, but I wasn't talking about using the clipboard to bring the characters into VB from the text file. I meant for you to actually open the file with your VB app and read the characters, like this:

Code:
Dim Char1Upper, Char1Lower, Char2Upper, Char2Lower, Char3Upper, Char3Lower, Char4Upper, Char4Lower  

Dim LineIn as String

'Put the path to your text file here
Open "D:\Temp\SpecialChars.txt" For Input As #1
LineInput #1, LineIn

Char1Upper = Mid(LineIn, 1, 1)
Char1Lower = Mid(LineIn, 2, 1)
Char2Upper = Mid(LineIn, 3, 1)
Char2Lower = Mid(LineIn, 4, 1)
Char3Upper = Mid(LineIn, 5, 1)
Char3Lower = Mid(LineIn, 6, 1)
Char4Upper = Mid(LineIn, 7, 1)
Char4Lower = Mid(LineIn, 8, 1)

Close #1

Then, just use Char1Upper, etc. in your replace statements.

Also, ignore the part of my previous post where I said to separate the characters with commas. Instead, just put the characters in with no separators (e.g., AaBbCcDd).

Let me know if this works.

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
I had understood you the first time and I had done exactly as you said (including omitting the commas!) (we think on the same wavelength :) ). Anyway, the clipboard comes in only when I have to output the result. In fact I also outputed the result using the msgbox command and got the same result.
 
Ok...well, I'm stumped. Sorry I couldn't be of more assistance.

Good luck!

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
In Word2000, where the characters are being displayed correctly, what font(s) show those characters correctly?

If you then use the same font(s) and try to display the same hex codes in VB6, what happens?

Last thought, there is a text editor that I have used for years (namely "TextPad"), what happens if you use such a generic (and simple) editor and then try and display (and print) those hex codes within the appropriate font(s)?

Cheers.

"Life is full of learning, and then there is wisdom"
 
fischadler said:
Believe it or not, the special characters appeared properly in the preview! But I didn't check how they finally appeared in the posting.
Yes, it's a known bug in the forum software.

Chip H.


____________________________________________________________________
Click here to learn Ways to help with Tsunami Relief
If you want to get the best response to a question, please read FAQ222-2244 first
 
koala15 said:
In Word2000, where the characters are being displayed correctly, what font(s) show those characters correctly?
This works fine with most fonts that come with Word 2000 (Arial, Times New Roman, Comic,... etc).
I think I know the unicode number of those characters (isn't that the number used in HTML?) but I don't know how to use hex codes.
 
OK. I found a sort of solution. I had to do it in ASP since HTML is Unicode compatible. Here's the code I've used, even though this is not an ASP forum:
Code:
strInput = Request.Form("txtInput")
strOutput = REPLACE(strInput,vbCRLF,"<BR>")
strOutput = REPLACE(strOutput,"~","&#266;")
strOutput = REPLACE(strOutput,"`","&#267;")
strOutput = REPLACE(strOutput,"{","&#288;")
strOutput = REPLACE(strOutput,"[","&#289;")
strOutput = REPLACE(strOutput,"}","&#294;")
strOutput = REPLACE(strOutput,"]","&#295;")
strOutput = REPLACE(strOutput,"|","&#379;")
strOutput = REPLACE(strOutput,"\","&#380;")
Response.Write strOutput
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top