Last post Aug 12, 2005 04:24 AM by mowie
Jun 28, 2005 06:48 AM|mowie|LINK
CREATE TABLE `newjpcontent` (
`Id` int(11) NOT NULL auto_increment,
`content` varchar(17) default NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
<%@Page Language="VB" ResponseEncoding="UTF-8"%>
<%@ Import Namespace="System.Data"%>
<%@ Import Namespace="System.Data.Odbc"%>
Protected myConnection As New
Sub page_load(ByVal sender As Object, ByVal e As EventArgs)
Dim da As New OdbcDataAdapter
Dim dt As New DataTable
Dim dr As DataRow
da.SelectCommand = myConnection.CreateCommand()
da.SelectCommand.CommandText = "SELECT * FROM newjpcontent;"
For Each dr In dt.Rows
litContent.Text &= "<p>Varchar content goes here</p><p>" & dr("content") & "</p>"
<asp:Literal ID="litContent" runat="server"></asp:Literal>
Jun 28, 2005 10:16 AM|Caddre|LINK
What you are getting is called character conversion, try the links below to get started. Hope this helps.
Jun 30, 2005 04:33 AM|mowie|LINK
Thanks for your post, I have worked through the MSDN resources tutorial and have no problems, I can get button controls to display Japanese or English.
As for the link to aspnetresources.com, I am not using VS (I am using Visual Web Developer), but I have double checked as far as possible that all source files are being saved as UTF8.
Do you have anymore hints? I found the links you posted very interesting.....
If it helps, I have posted the page to a live server,
http://domain835520.sites.fasthosts.com/default2.aspx obviously you will need to have the Japanese character pack installed to see the Japanese text in the page, but the content that comes from the MySQL db is under the paragraph titled 'Varchar content
goes here'. All I see is ????????.
Jun 30, 2005 07:13 AM|Caddre|LINK
Try these links one have a create table statement that may make a difference. Hope this helps.
Jul 01, 2005 07:15 AM|mowie|LINK
Jul 01, 2005 08:24 AM|Caddre|LINK
| ujis | EUC-JP Japanese | ujis_japanese_ci |
| sjis | Shift-JIS Japanese | sjis_japanese_ci |
Jul 04, 2005 07:13 AM|mowie|LINK
Thanks for trying Caddre!
I followed the MySQL documentation in creating a new database as Shift-JIS, and then converted the source files to Unicode. When I entered the text into the table column it immediately converted to ?????.
Using UTF8 db tables, and source files saved as UTF8 I can populate the DB correctly, however the problem is then displaying the text in the webpage. I have set globalization to utf8, and can display the same text using static code (stored directly in the
I converted some characters to hex (EG 風) these displayed without a problem - is there a method to convert a utf8 string to a hex?
I feel like I have come to the end of the error solving procees, and I guess there is something incorrect with my setup (though I have used a server hosted by an external hosting co. and a local development server).
I'd appreciate any further assistance.
Jul 26, 2005 05:14 PM|tatemononai|LINK
Aug 03, 2005 07:22 PM|Caddre|LINK
Aug 11, 2005 11:50 PM|Shilpa Yadla|LINK
Try changing the datatype of your Contents column in your table to NVarchar instead of varchar. This is the Unicode formatting.
This should work.
Aug 12, 2005 04:24 AM|mowie|LINK