diepm / vim-rest-console

A REST console for Vim.
658 stars 54 forks source link

how to chinese unicode convert utf8 #27

Closed aslijiasheng closed 8 years ago

aslijiasheng commented 8 years ago

create sample.test file `// Examples of some ElasticSearch requests.

View nodes status

http://172.28.128.3:9200 GET /_search result: HTTP/1.1 200 OK Content-Type: application/json; charset=UTF-8 Content-Length: 684

{ "_shards": { "failed": 0, "successful": 5, "total": 5 }, "hits": { "hits": [ { "_id": "2", "_index": "index", "_score": 1.0, "_source": { "content": "\u516c\u5b89\u90e8\uff1a\u5404\u5730\u6821\u8f66\u5c06\u4eab\u6700\u9ad8\u8def\u6743" }, "_type": "fulltext" }, { "_id": "4", "_index": "index", "_score": 1.0, "_source": { "content": "\u4e2d\u56fd\u9a7b\u6d1b\u6749\u77f6\u9886\u4e8b\u9986\u906d\u4e9a\u88d4\u7537\u5b50\u67aa\u51fb \u5acc\u72af\u5df2\u81ea\u9996" }, "_type": "fulltext" }, { "_id": "1", "_index": "index", "_score": 1.0, "_source": { "content": "\u7f8e\u56fd\u7559\u7ed9\u4f0a\u62c9\u514b\u7684\u662f\u4e2a\u70c2\u644a\u5b50\u5417" }, "_type": "fulltext" }, { "_id": "3", "_index": "index", "_score": 1.0, "_source": { "content": "\u4e2d\u97e9\u6e14\u8b66\u51b2\u7a81\u8c03\u67e5\uff1a\u97e9\u8b66\u5e73\u5747\u6bcf\u5929\u62631\u8258\u4e2d\u56fd\u6e14\u8239" }, "_type": "fulltext" } ], "max_score": 1.0, "total": 4 }, "timed_out": false, "took": 2 } `

content auto convert unicode
how to convert utf8?

diepm commented 8 years ago

Does the output display the correct Chinese characters when you run this command in the console?

curl --get http://172.28.128.3:9200/_search
aslijiasheng commented 8 years ago

@diepm yes
image

diepm commented 8 years ago

I've added a new option, vrc_auto_format_uhex, to transform the \uXXXX instances to the corresponding symbols.

aslijiasheng commented 8 years ago

@diepm image hello diepm! I have already git pull and restart run sample.vim ! chinese simple still unicode My option isn't problem?

diepm commented 8 years ago

Hi @aslijiasheng, did you enable the option by let g:vrc_auto_format_uhex = 1? It's turned off by default.

aslijiasheng commented 8 years ago

@diepm thanks I can convert chinese simple