Printing Chinese Characters
I have a problem where I need to print and english description of a product with the chinese version printing underneath it.
I'll post a brief outline of the code I'm using. All of the descriptions are read in from a unicode text file, and I'm attempting to use the printer object to print.
I've tried printing the chinese without strconv, with strconv(vbfromunicode), and strconv(vbunicode) but none of these seem to work. I normally just get ? for each chinese symbol.
The GetChinese and GetEnglish function simply slice the read line into the correct parts. These values are then stored in a textbox control. This all works fine, the chinese symbols are displayed correctly. It's the printing part that I require help with.
Code: ff = FreeFile Open App.Path + "dingchin.txt" For Binary As #ff Text = InputB(LOF(ff), #ff) Close #ff txtChinese.Text = GetChinese(Text) txtEnglish.Text = GetEnglish(Text) Printer.FontName = "Arial" Printer.Print GetEnglish(Text) Printer.FontName = "MS Song" Printer.FontSize = 18 Printer.Print GetChinese(Text) 'I've also tried txtChinese.Text Printer.FontName = "control" Printer.Print "P" Printer.EndDoc
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Problems With Chinese Characters And Standard Western European Characters In One Text
Hello everybody,
I really can't figure out what happens n my program.
I have a ms forms 2.0 textbox that is able to display unicode characters.
I can add chinese character, without any probem.
I can even save them to my recordset with
RSRepKopf!FEHLERBEZ = StrConv(txtProblem.text, vbUnicode)
This works as long as I don't have other european characters or blanks, or linefeeds within the textbox.
How can I make the system handle (display, save and load) all kinds of information???
Any comment is highly appreciated. Thanks.
Christian
Chinese Characters
hi all,
im using Win2k pro and i've setup the Chinese language in Ctrl Panel.
How to display those characters in a multiLingual application..? (i know about resource file, just i need to display the chinese characters..)
Thanks !
alex
Using Chinese Characters
I am trying to write a flash card program for a chinese class I am taking, but I can not figure out how to add the chinese characters. I am hopeing that there is a way to do this. I have though of using pictures, but that can add up. Any ideas?
Chinese Characters In VB
Hi,
I am developing a chinese application using VB. I am storing my data in MS Access using unicode. But when i try to display the same in my application i am not able to display it properly? i am using MS Moncha font. Can anyone help me?
Regards,
V.Bhaskar.
Chinese Characters (Unicode) In VB6
Does anyone has experience in using chinese characters on VB6 form and control captions?
I have a multilingual XP-System (german/chinese) and a VB6, SP5.
The texts are read from a unicode text file, where they are correctly displayed when I open the file with notepad.
In my application only questionmarks where displayed.
What do I have to change? Is it possible at all?
Regards
Martin
Chinese Characters In Excel
Hi All,
1. I have stored BIG5 / GB2312 Data encoded using some Chinese IME Tool in Oracle Database.
2. User now wants to retrieve this characters to show it onto XL sheet using Visual Basic.
3. If am running Chinese IME in background, then If I generate the Excel Report through VB, I can see that Characters as Chinese Characters, If the Chinese IME is not running in background, then I see these data as junk Characters something like this
Eg: ²»ÄÜ»½ÐÑÄã
4. Am using this Program in Client-Server Program not an Web-Based Application.
5. My Program actally generates 100's of Excel Report and save it into Hard Disk, later it will be distributing to other countires, they should able to see these Chinese Characters without any Chinse IME.
Issue is :
Is there any way in Visual Basic to convert these characters into Excel understandable format and display as Chinese Characters?
Even I did try using MultiByteToWideChar API in Windows.
Private Declare Function MultiByteToWideChar Lib "kernel32" (ByVal CodePage As Long, _
ByVal dwFlags As Long, ByVal lpMultiByteStr As String, _
ByVal cchMultiByte As Long, ByVal lpWideCharStr As String, _
ByVal cchWideChar As Long) As Long
Function ascii2unicode(a As String) As String
Dim size As Integer, u As String
size = MultiByteToWideChar(950, 0, a, -1, u, 0)
If size = 0 Then
Exit Function
End If
u = Space(size)
If 0 <> MultiByteToWideChar(950, 0, a, -1, u, size) Then
ascii2unicode = u
End If
End Function
after calling above function that returns me Unicode then I pass it to StrConv function in VB like
StrConv(ascii2unicode(),vbFromUnicode). It's printing some chinese Characters but it is not the same as what I see through using Chinese IME.
This Problem is taking my life. Pls. help me out
Best Regards,
Sridhar
Edited by - sridharmr on 7/8/2003 9:12:37 PM
Chinese Characters Handling
A program is written by Visual Basic 6.0, which is used to insert data into Access 97. If the data is "Chinese Characters", it display "???" in Access database.
Would you please advise how to solve it?
French Characters On A Chinese Machine
Hello.
We have an application that teaches French.
Running on Chinese windows, anytime a French character comes up on the screen such as or (all valid ASCII characters), chinese characters come up in their place.
So instead of seeing "frre", the person sees "fr[chinese character]e" where [chinese character] would of course be a Chinese character which I can't draw here.
Any ideas how to solve this?
After all, if I says label.caption="frre" and all the characters are in the ASCII set, then it would be expected that the word "frre" appears on the screen.
Any help would be appreciated.
David
French Characters On A Chinese Machine
Hello.
We have an application that teaches French.
Running on Chinese windows, anytime a French character comes up on the screen such as or (all valid ASCII characters), chinese characters come up in their place.
So instead of seeing "frre", the person sees "fr[chinese character]e" where [chinese character] would of course be a Chinese character which I can't draw here.
Any ideas how to solve this?
After all, if I say label.caption="frre" and all the characters are in the ASCII set, then it would be expected that the word "frre" appears on the screen.
Any help would be appreciated.
David
Saving Chinese CHaracters To Txtfile
Hi all, i'm trying to save chiense CHaracters to a textfile on my pc, here's what i have.
Code:
Private Sub CommandButton1_Click()
' create a Unicode text file with Chinese character
' Dan1 and English character D.
Open "unicode.txt" For Binary As #1
Put #1, , TextBox1.Text
Close #1
End Sub
The chinese characters i'm trying to save are these 3 words "简体字"
The textbox i'm using are 2.0 Forms and when pasting these 3 words on the textbox it displays properly after setting the font to Arial_Unicode_MS, Script is Chinese_GB2312
however when i click on the button what i get in my "unicode.txt" is ???
My font on my notepad for this textfile is also set to Arial_Unicode_MS, script : Chinese_GB2312. If i copy and paste the 3 chinese characters "简体字" it displays properly on my notepad.
Anyone know what's the code i'm missing to fix this problem?
thx
Saving Chinese Characters To Txtfile
Hi all, i'm trying to save chiense CHaracters to a textfile on my pc, here's what i have.
Code:
Private Sub CommandButton1_Click()
' create a Unicode text file with Chinese character
' Dan1 and English character D.
Open "unicode.txt" For Binary As #1
Put #1, , TextBox1.Text
Close #1
End Sub
The chinese characters i'm trying to save are these 3 words "简体字"
The textbox i'm using are 2.0 Forms and when pasting these 3 words on the textbox it displays properly after setting the font to Arial_Unicode_MS, Script is Chinese_GB2312
however when i click on the button what i get in my "unicode.txt" is ???
My font on my notepad for this textfile is also set to Arial_Unicode_MS, script : Chinese_GB2312. If i copy and paste the 3 chinese characters "简体字" it displays properly on my notepad.
Anyone know what's the code i'm missing to fix this problem?
thx
Chinese Characters In A Listview COntrol
Hope someone can help.
I need to display a string of Chinese characters in a listview control - character set gb2312.
I believe the listview control does not support unicode but the microsoft forms text box does.
I have the string stored in MS Access which I can see using the SIMSUN font, but when I query using VIsual Studio DataEnvironment I get loads of "????????"
I need to display the result in the text box.
If I do a make table query inside access then export the result to a utf-8 text file I can use the CHilKat utilities to read the file convert to unicode and display in the text box.
There must be a better way.
If the above is the only way I need the vb code to do the export of table to a utf-8 text file.
Thanks in advance.
Andrew
How To Display Chinese Characters In Source Code?
I have enabled chinese characters in my regional settings and tested entering chinese characters in notepad.
However, when I entered the chinese characters in VB6 code window, all I get is ???? (one question mark for each character).
How do I enable VB6 to display the chinese characters as it is?
Any help will be much appreciated.
Thank you.
Unable To Return Chinese Characters To VB6 Client
Hi,
I'm using VB6 with SQL Server 2000 as backend. One of the fields in a table is set to NVARCHAR. If I use SQL Query Analyzer to update and retrieve the records with Chinese characters, everything displays OK. However, when I retrieve the field in the VB client, it will only show garbage instead of Chinese characters.
I have tried it on a PC with Chinese NT, it displays the Chinese characters without problem. According to MSDN, VB stores the data in UNICODE so how come I can't display the Chinese characters correctly in English Windows?
Disable To Display Chinese Characters In Recordset
Hi to all.. i have a strange problem with my db.
Situation:
db: Access(2003) db
Method used with vb to access to db: ADO 2.8 & Sql language.
Provider choosen: Jet 4.0
Problem:
I have a table with chinese string. If i open it with Microsoft Access i can see all the string. If i open it by vb code a store it in a recordset, the values of recordset are '?????' instead chinese char.
Somebody can help me?
File Created Does Not Show Chinese Characters
Hi,
I have a Visual Basic 6.0 application that read data from an Excel spreadsheet that has Chinese unicode characters. I produce a report using the "print" fuction to copy some of the Chinese strings to a text file. When I open the report with Notepad, the Chinese characters are shown as "????". In Notepad, I am using the Ariel font which should handle the unicode. Is there a problem using the Print function for unicode characters? Should I be using something else?
Thank You for your help.
Charles G.
Need Help In Writing And Reading Chinese And Korean Characters Into/from A .txt File
Hi ,
I use Windows 2000 Professional English OS and Visual Studio 6.0 (English version) for development.
I have to pass strings from VB application to VC dlls and get strings back from the VC dlls to VB application.
These strings can be Japanese , Chinese , Korean.
1. I set all the Locales default to Japanese and had the default IME version as Japanese in the control panel settings. Restarted my machine. Using charmap , I copied a Japanese text and pasted in the VB text box and passed the text to the VC dll which uses _tfopen , _fputts to write the Japanese input string into a .txt file. The VC dll uses _tfopen and fgetts to get the Japanese string from the same file and appends a string _T(" : Output") to the string read from the file and sends it back to the VB application. The VB application displays the string from the VC dll in another text box. When I open the file using Notepad , I see Japanese characters in the file and when I go to the menu option Save As in the notepad , I see the current file to be of type Unicode.
2. I seem to have successfully passed the Japanese characters from VB to VC . But I am unsuccessful in passing Chinese and Korean strings from VB to VC. I made the appropriate Locale settings and the IME settings for chinese and korean and restarted the machine. But the file created by the VC dll does not have the input I passed to it. It either has ???? or some other characters other than the ones I passed. Could anyone help on what should be the settings on the VB , VC and the system settings for me to pass Chinese and Korean characters from VB to VC and to write correctly the Chinese and Korean characters properly into the file by a VC dll.
3. Though I seem to have successfully passed on the Japanese characters from VB to VC , I still do not know what are the basic requirements for this to be successful. So it would be helpful if some one could tell me the settings for VB , VC and system for passing Japanese characters from VB to VC and to write correctly the Japanese characters properly into the file by a VC dll
Regards
Prabha
Easy Way To Get Russian/Chinese Characters On Label (the Solution, Not A Question)
I searched the forums, and I couldnt find a way to do it. Now that I did find a way, I thought Id share it. I dont know where else to post it. It's extremely easy. First, open Word, and write down something you want in the language (I take Russian for example). Then use Word to save the file as a .txt, using the right encoding (word will ask for this). For Russian, this is Cyrillic Windows. Then open the .txt file, you'll see some weird characters. Select those characters, and copy them to the clipboard.
Now open your project, and select the label (works for any control). Change the font to a font that supports Cyrillic (good ones are Arial and Times New Roman) and use the listbox in the font selection to change the display to Cyrillic. Now simply paste the text in the caption of the label, and all done, there is now russian text on your label.
I hope this helps some people, ive had nightmares on this one.
Non Printing Characters
every so often when Im pulling data out of a binary file (whose record sizes are supposed to all be the same) i pick up some stray nonprinting characters.
This would be fine if all they did was not print - however when I output my results to a text box for viewing these control characters have the effect of making all text after them not appear in the text box. As far as i can tell the offending hex values are just 00.
Is there anyway I can test a byte to see if its a printing or non printing character?
Printing Unicode Characters
Any way (API, RichTextBox, whatever) to print characters from a font above the 255 value?
I would like to be able to use the old graphics characters that were very easy to do in the old days of Basic (not VB) that represent border lines and corners. These characters are still available on some fonts but their values are above the 255 limit of the VB command Print Chr(value).
Removing Non-printing Characters
Hi,
Currently I have a project where the result string is padded with non-printing characters like Asc 0.
At the moment I am using the replace funtion like so..
VB Code:
frm13481a.lblRIC_BAR.Caption = Chr(42) & "RIC" & rs("ui") & _rs("qty") & rs("loc_a") & Replace(Trim(Replace(strPrice, Chr(0), "")), ".", "") & Chr(42)
The chr(42)'s you see are for my barcodes that I need. I have to use replace twice to get rid of what needs to not be included.
Now, what I am looking for is feedback on how I should or how you all check for and replace non 1-9,a-z,A-Z characters in a string?
Thanks,
John
Font For Printing Box Characters
Hi everybody,
I have made a print utility based on the Rich-text box control. I first direct the output to the rich-text box and then print it using its print method. Now, for printing tabular reports, which have horizontal and vertical lines around the headers and columns, I use box characters. I use the font "MS LineDraw" which is a proportional font and has box characters. But the only limitation of this font is that, I can't make the headings bold because the size of the characters increase. Is there any proportional font having box characters and whose character width does not increase on making bold ?
Printing A String Of Characters
I am trying to print a long string of characters (100 bytes or more) stored in a database. The problem that I am having is that I want 30 or so characters to print in a certain section on the page.
Code:
Printer.Print txtInk1(0).Text;
If the length of the characters in thetext box is greater than 30, break on the next line. If it is greater than 60, break again....
This should be easy, but I am tired being that I stayed up late to watch the Yankees. Thank You.
Printing Special Characters
I have created some reports using VB6. When trying to print the reports some of the data has special symbols like accent marks over the letters. (ie. spanish words) However, the accents will not print correctly.
How can I resolve this ?
Thanks in advance for any helpful advice...
Printing Unicode Characters (urdu)
hi all.....
someone come across anything that helps print unicode characters.....
i wanna print urdu (or arabic)
i came acros quite a few proggys but none complied with unicodesupport.....they wud simply print.... question marks....
i want to be able to print from a MS Forms 2.0 Object LibraryTextbox....
thanx.
Special Characters For Printing Differently
Freinds,
When we were sending some characters to the dot matrix printer, it will print data in different style means bold, semi bold or italics.
Anybody knows about what all are the characters.
Your answers are appreciable.
Thanks in advance.
Extracting And Printing Defined Characters From A Substring
I wish to print into a label the first 3 characters from a text box called txtSurname.text, and a string variable called surname. The current code looks like
Code:
lblRef.Caption = surname & Int(Rnd * 100)
As it is, the full surname prints in the label followed by a random number between 1 and 99. I wish it to print the first 3 letters of the surname followed by the random number.
As far as I know this uses substrings. Could anybody show me how to do this.
The label is lblRef.caption the surname is txtSurname.text
Printing Special Characters To Text File
I have an app that pulls html formatted text out of a database and stores it into a text file.
How do i convert number codes such as Code:® into this -> ® ?
Are there vb constants that do this?
Any help would be greatly appreciated.
Problem Printing More Than 132 Characters Through &"Generic / Text Only&"
Hi all, I'm having a bit of a problem.
I need to print to a OkiData MicroLine 591 printer in text only mode. The reason it MUST be in text only mode is because if I attempt to go through the normal setup (Printer driver set to EPSON LQ 2550 (Yes, that's the correct driver even though the manufacturer is OkiData))
I've attempted to set up a printer called "LinePrinter" on my computer and then set the driver to "Generic / Text Only" and this works GREAT... Until the wide format report needs to be printed.
See, this report is 238 characters wide, the "Generic / Text Only" driver truncates each line to only 132 characters. Thus rendering the "Generic / Text Only" solution moot.
The printer MUST have a printer driver that Citrix can see (Printing over citrix is about as fun as stabbing yourself in the hand) so I'm stuck trying to find some sort of solution in driver form, that supports not only printing the whole width of the report, but also allows the printer to be run in "Utility" mode so it prints each way the printer head goes (much faster).
So, is there any way that I can do the following.
Print TEXT ONLY that has a width > 132 characters.
OR
Is there some documentation somewhere to get me started on writing a custom printer driver that can send more than 132 characters to the printer at a time.
Thanks in advance.
Chinese & Vb
Hi everyone,
I'm working on a computer with windows 2000 installed on it and chinese as a default language.
When I try to work with vb 6.0 I get a system error msg, and the vb get closed.
The msg is saying something about error when reading from the memory.
It accures or when I open an existing vb application, or if I open a new application when I click on a command button in order to move to the code editor.
How can I work with vb on my computer?
Thanks,
Shuly.
Chinese Chekers
Hi I need help in doing a project for my computer class and I don't know how the heck shall I do to move an object and I have to do the chinese chekers so imagine!!! I would appreciate you to be as simple and clear as posible because I'm a beginner so I don't knwo to much about visual. thanks
Encoding Chinese URL
The encoding for Chinese Character love
愛
is
%E6%84%9B
You can go http://blogdigger.com/search?q=%E6%84%9B&sortby=date to make sure.
However, if I type the AscW(sTmp) where sTmp is the Chinese Character,
I got
24859
Now, can we use Chinese character in visual basic?
For example, can we type
ascw("愛")
Also, what is the connection between number 24859 to %E6%84%9B
As far as I know hex(24859) is 611B and not E6849b
So, what am I missing here?
How Handle Chinese...
Hello,
I write a kind of notepad but some Chinese user says this software doesn't support his charset. Sincerely I have no glue how to make my simple software, it's a little bit more than a text box and save routine, compatible to Chinese char set. I develop using Win2000 English version under VB6
Can anyone help me?
Txs
Chinese Char
why all this Combobox, Listbox, DBcombo, DBList cannot show Chinese char? any solution.. 10q
Pls Help With Chinese Character!!
VB6 + sp5
i tried to type my chinese word in text but couple words seem not support or what, just show question mark??
did anyone know how to do with this??
thanks in advance!
ricky
Chinese Diagnostics.
I'm in an awkward predicament. I'm using a Chinese language version of Windows+VB6+MS SQL Server. I don't read Chinese. I'm actually teaching some programming classes in China. Mostly stuff that I know, and I'm a very experienced programmer (well, very old anyway) - unfortunately I got landed with VB6+MS SQL Server - which I've had to get up to speed with over the weekend.
So, I'm trying to set up SQL servers in Chinese, Modifying (guessing) datalink settings (in the Data View window) in Chinese, and running a simple program to connect to the database that gives me an error message in Chinese (after a delay that suggests it's trying to do something).
It has some English...
"Run-time error '-2147467259 (80004005)':
[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server" - then chinese....
It happens when I call ADODB.Connection.Open
I suspect my ConnectionString is wrong. I've tried a few things and got various Chinese diagnostics - but nothing that gives me a clue.
I just want to get at the "pubs" example for now. (I can see it's structure in the Data View window). Everything is local, on the same computer. No need for security.
If I got this working, I'd like to be able to set up a blank database in which I could create new tables under program control. The program is not a problem - but connecting to the database to start with is my barrier.
Any suggestions?
MSCOMM32 On Chinese XP
Hi,
I have a number of applications that have been widely used by UK, US and European customers.
These applications are now being rolled out to Chinese customers and they are having problems with serial communications.
The serial port, using the MSCOMM32 V6 control just does not seem to be working. No error messages have been reported and until I can get hold of a copy of Chinese XP and load it onto a system, I am having to stab around to try and get some info on a possible solution.
I am guessing that this is a DBCS related issue.
Does anyone out there have any suggestions?
OptionButton In Chinese
What is the different between Label and OptionButton when showing Chinese Characters?
The Label (Label1) shows correct Chinese Characters but the OptionButton (Option1) not.
Private Sub Option1_Click()
Option1.Font.Name = "MS SONG"
Option1.Font.Size = 9
Option1.Font.Charset = 134
Option1.Caption = "ᷢײ"
Label1.Font.Name = "MS SONG"
Label1.Font.Size = 9
Label1.Font.Charset = 134
Label1.Caption = " ᷢײ"
End Sub
Typing Chinese Into VB
Does anyone know how to type chinese characters into Visual Basic IDE? I have tried all of the 'normal' methods of doing so, however once they have been inputted they all turn into ??s
I am trying to use string tables for multiple languages - so that I dont have to write heaps of if() statements when all I want to display is a msgbox!
Does anyone know a workaround for this?
Chinese Support
Is there a way to support chinese in visual basic on an american OS? I need to know because I have to make a program into a few languages such as chinese and I am not able to see the characters on my machine. They just appear as a bunch of random symbols. I tried enabling foreign language support, but that really didn't seem to do anything. Any help would be appreciated. Thanx!
Chinese Character
Hi, i'm trying to code a function that would convert character's hex code to UTF format and save it in a MySQL database. However i found that i need to convert the charater in to ISO-8859-1 format first before i can stream it into the database, is there any function in VB 6.0 that would allow me to change the format of a string??? or i need to use VB.net to do it??
Any suggestion is welcomed. Thanx a lot!!
fLy
|