write_csv()
中的 readr
输出μ作为μ。如何使用write_csv()
正确输出μ?
library(tidyverse)
x <- tribble(~x, 'µ')
write_csv(x, 'test.csv')
答案 0 :(得分:1)
$('#calendar').fullCalendar({
defaultDate: "{{ $month_year->format('Y-m') }}",
defaultView: 'month',
displayEventTime: true,
showNonCurrentDates: false,
eventWidth: "100%",
eventHeight: "100px",
timeFormat: 'H:mm',
header: {
left: '',
center: '',
right: ''
},
eventClick: function(jsEvent) {
$('#m_modalCal_' + jsEvent['id']).modal("show");
},
events: [
@php foreach($trainings as $training)
{
$dateTimeStart = $training->start_date->format('Y-m-d ').Carbon::parse($training->start_time)->format('H:i:s');
$dateTimeEnd = $training->start_date->format('Y-m-d ').Carbon::parse($training->end_time)->format('H:i:s');
@endphp
{
id: "{{ $training->id }}",
title: "{{ $training->title }}",
start: "{{ $dateTimeStart }}",
end: "{{ $dateTimeEnd }}",
@if($training->type_id == 1)
color: "#C0FFEE",
textColor: "black",
@elseif($training->type_id == 2)
color: "#E8D091",
textColor: "black",
@else
color: "#A491E8",
textColor: "black",
@endif
@if($training->status == 2)
color: "gray",
textColor: "black",
@endif
},
@php } @endphp
],
})
在tibble中的字符使用UTF-8编码的原始字节中时将正常工作。
write_csv()
答案 1 :(得分:0)
尝试设置正确的fileEncoding = UTF
write.csv(x, 'test.csv', fileEncoding = "UTF-16")