如何从mysql到visual fox pro获取utf-8字符

时间:2013-03-04 13:22:26

标签: mysql utf-8 visual-foxpro

我有一个带有单列的MYSQL表。数据库,表和列排序规则设置为:utf8_general_ci。
使用浏览器,我在该字段中插入字符串。如果我插入像:şţăîâ或ŞŢĂÎ的字符,它插入确定。我可以使用Phpmyadmin看到它们 我的问题是当我想在Visual Fox Pro中使用该表时 我正在使用这个:

conn_str="Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=database_name;User=user_name;Password=pass;Option=71305256"
conn=SQLSTRINGCONNECT(conn_str)    

SQLEXEC(conn,"SET CHARACTER SET utf8")
SQLEXEC(conn,"SET COLLATION_CONNECTION='utf8_general_ci'")

SQLEXEC (conn,"select * from table_name","Cursor")

但是在vfp游标中,像şţăî这样的字符串看起来像???î 有什么帮助吗?

2 个答案:

答案 0 :(得分:1)

我认为你必须将你的MySQL改为某些ANSI charset,如CP-1252,因为visual frox pro似乎不支持utf-8。看到 What's the problem with Unicode support in Visual FoxPro

答案 1 :(得分:0)

您需要将<template> <div> </div> </template> <script> import OT from "@opentok/client"; export default { name: "publisher", props: { session: { type: OT.Session, required: false }, rlive: Boolean, opts: { type: Object, required: false } }, mounted: function() { // console.log(this.rlive) console.log("publisher created") console.log(this.session) const publisher = OT.initPublisher(this.$el, this.opts, err => { if (err) { this.$emit("error", err); } else { this.$emit("publisherCompleted"); } }); this.$emit("publisherCreated", publisher); const publish = () => { this.session.publish(publisher, err => { if (err) { this.$emit("error", err); } else { this.$emit("publisherConnected", publisher); } }); }; if (this.session && this.session.isConnected()) { // console.log("this.session && this.session.isConnected()") publish(); // console.log(publisher) } if (this.session) { console.log("this.session") console.log(publisher) this.session.on("sessionConnected", publish); } if(!this.session){ console.log("!this.session") } }, beforeDestroy: function(){ console.log("before destroy"); console.log(publisher) console.log(publish) //here is where I want to KEEEEEL! // console.log(publisher) // console.log(this.session) } }; </script> 转换为strings。例如:

binary